Manouk Posted February 14 Share Posted February 14 Hi, I'm looking for a CSS code to change alignment on text block in mobile ONLY. Preferably center, but also would love the codes for left / right. Need it on a lot of blocks but as an example: homepage text block on mobile: #block-ed20e2002a61eaf311bb password: smoothie123 I tried this CSS but it is not working: @media screen and (max-width:767px) { #enter-block-id-here>div { text-align: center !important; } } Link to comment
Ziggy Posted February 14 Share Posted February 14 5 minutes ago, Manouk said: @media screen and (max-width:767px) { #enter-block-id-here>div { text-align: center !important; } } You need to replace this text "#enter-block-id-here" with the actual block ID you want it to apply to. How to find the block ID:https://squarefortytwo.com/squarespace-guides/find-an-id-in-squarespace-71 Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) ✨ Spark Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
Flinx Posted June 6 Share Posted June 6 Hi there, I'm using the blog-id, but I can't make this work. Do you have any other suggestions? Thanks a lot! @media screen and (max-width:767px) { #block-2c06e5bedf7554ffcf3f>div { text-align: center !important; } } Website: www.possing.dk Link to comment
Ziggy Posted June 6 Share Posted June 6 The code works just fine in my testing. Can you share the page you are trying to get this to work on? Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) ✨ Spark Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
Flinx Posted June 7 Share Posted June 7 Thanks for looking into it! It's on the front page of www.possing.dk - second section. @media screen and (max-width:767px) { #block-2c06e5bedf7554ffcf3f>div { text-align: center !important; } } Link to comment
Ziggy Posted June 7 Share Posted June 7 I can't see any evidence of the CSS in your page code, but I also still don't see any reason why it wouldn't work if you've applied it in Custom CSS. It may not work if you have errors in the Custom CSS. I'm not sure how to help further unless you can give me access to this website. Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) ✨ Spark Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment