How can I set the text in the middle of the bar?
Topic summary
A user seeks help centering text within an announcement bar on their Shopify store, providing a screenshot showing the current alignment issue.
Responses provided:
- One responder claims the text already appears centered based on their inspection
- Two CSS solutions are offered:
- Adding
top: 2px;to.announcement-bar__messagevia Theme Customize > Custom CSS - Using flexbox properties (
display: flex; justify-content: center; align-items: center;) on.page-width.utility-bar__grid .announcement-barin the theme’s CSS file
- Adding
Both CSS solutions include before/after screenshots demonstrating the centered result. The discussion remains open with no confirmation from the original poster about which solution worked or if the issue is resolved.
Hi @NikosBat
You can try this code and follow instruction below:
-
Go to Shopify > Theme > Customize
-
Copy and paste this code on Theme settings > Custom CSS section
.announcement-bar__message {
top: 2px;
}
Result:
I hope it helps.
Esther
Hi @NikosBat Now it will stay in the center.
- Go to Online Store → Theme → Edit code.
- Open your theme.css / based.css file and paste the code in the bottom of the file.
.page-width.utility-bar__grid .announcement-bar {
display: flex;
justify-content: center;
align-items: center;
}
Result:
If my reply is helpful, kindly click like and mark it as an accepted solution.
Thanks!



