Jump to content

center align all text on mobile ECXEPT two blocks

Recommended Posts

Hello,

I used this code to center align all text on mobile:

@media only screen and (max-width: 767px) {
p, H1, H2, H3, H4 { text-align: center; }}

I have two text blocks I want to exclude from this rule (left alignment also on mobile). Is there any css to fix it?

Thank you very much!

Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

If you target those text blocks (with block IDs) with text-align:left; below the centering CSS it will re-align the text left. 

CSS gets read and implemented by your browser from top to bottom, so if you set the text centered, and then set the same text left, it will keep the last one.

Please like and upvote if my comments were useful to you. Thanks!

Zygmunt Spray
Squarespace Website Designer
Contact me: https://squarefortytwo.com/ 
🔌Ghost Squarespace Plugins (Referral link)
Buy me a coffee

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.