Jump to content

Text aligned right on web is not center aligned on mobile

Recommended Posts

I have center aligned the whole website for mobile (CSS used is attached below), however this particular section does is not center aligned while viewing on mobile. Could someone please assist me on this matter? Thanks

@media only screen and (max-width: 640px) {
p, h1, h2, h3 {
  text-align: center;
  }
}

 

Web view:

image.thumb.png.019c17fad762f55d82dc94e5853abf85.png

 

Mobile view:

image.thumb.png.15f5333757e89f9ac6da705fd17e1579.png

Link to comment

Can you share your website URL so I can give you some correctly targeted CSS for this? Thanks!

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

Link to comment

If every piece of text on your website wants to be center aligned on mobile then you code (with a slight tweak) should work fine:

@media only screen and (max-width: 767px) {
h1, h2, h3, h4, p, a {
  text-align: center !important;
  }
}

If you want to target it just to certain pages, I would suggest adding page IDs like this:

@media only screen and (max-width: 767px) {
  #collection-63c8259c98ccce0339280130, #collection-63c865b2552b551c7de79343 {
    h1, h2, h3, h4, p, a {
      text-align: center !important;
    }
  }
}

This would just target the home and values pages. More IDs can be added, comma separated.

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

Link to comment
  • 2 months later...
21 minutes ago, Assad said:

text that should be aligned in the center appears to be shifted to the right

I can't see any text that is center aligned or shifted to the right. I don't see the problem you're having on the website or in the screenshots you provided.

Can you provide a little more context? 

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

Link to comment
On 4/21/2023 at 4:03 PM, Assad said:

I have a similar problem, whenever it's viewed on mobile the text that should be aligned in the center appears to be shifted to the right, could anyone please help?

image.png.883542710103a6e2dbbb3923900a2a19.pngimage.thumb.png.5e1e7a11e981bbfa9be01c5db7606a08.png

https://swan-coyote-5l6c.squarespace.com/

pw = bongo

Add to Design > Custom CSS

@media screen and (max-width:767px) {
.fe-643d37df5d41246dce6a7211 {
    grid-column-gap: 20px !important;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
3 hours ago, Assad said:

@Ziggy @tuanphan unfortunately this did not resolve the issue, I'm afraid. Would you have any other suggestions? Thanks a lot for thinking a long, appreciate it!

 

 

IMG_4767.PNG

IMG_4768.PNG

 

You can fix this by going into Mobile view in the editor and aligning the blocks.  Your blocks all start on grid column 2 (slightly to the right) in this section.  

Grab each block and center it on the page.


Your current position is

grid-area: 2/2/5/10

I think you want:

grid-area: 2/1/5/10

 

Once you have your blocks centered, you can just choose to center align the text.


 

Contact Us for detailed help

Common Squarespace Tips

Sharing Your Site Link

Squarespace web designers in Perth WA.

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.