Manouk Posted February 14, 2023 Share Posted February 14, 2023 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, 2023 Share Posted February 14, 2023 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 ☕ 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
Flinx Posted June 6, 2023 Share Posted June 6, 2023 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, 2023 Share Posted June 6, 2023 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 ☕ 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
Flinx Posted June 7, 2023 Share Posted June 7, 2023 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, 2023 Share Posted June 7, 2023 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 ☕ 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
grxdesigner38 Posted January 4 Share Posted January 4 I'm having a similar issue. I have separate text blocks: some with pricing and some with text only. The text only is centering but the pricing is not. Here is the code I'm using for the first two, as an example. @media screen and (max-width: 767px) { #block-yui_3_17_2_1_1704401863200_30305 { text-align: center; } #block-e84e5c5da83dc603066e { text-align: center; } } https://blenny-indigo-cspb.squarespace.com/weddings pw: 550Reach Link to comment
tuanphan Posted January 8 Share Posted January 8 On 1/5/2024 at 4:58 AM, grxdesigner38 said: I'm having a similar issue. I have separate text blocks: some with pricing and some with text only. The text only is centering but the pricing is not. Here is the code I'm using for the first two, as an example. @media screen and (max-width: 767px) { #block-yui_3_17_2_1_1704401863200_30305 { text-align: center; } #block-e84e5c5da83dc603066e { text-align: center; } } https://blenny-indigo-cspb.squarespace.com/weddings pw: 550Reach Use some code like this, this code for $6000 text @media screen and (max-width:767px) { div#block-69164261090989ef09db .sqs-html-content { display: flex; text-align: center !important; align-items: center; justify-content: center; } div#block-69164261090989ef09db .TextShape-node { left: 50% !important; transform: translateX(-50%) !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
RebelRuth Posted March 7 Share Posted March 7 Hi, Thank for the tips above, I've tried to apply the same to my footer and it works but only on one of the text ID blocks, really weird that it works on one and not the other! The code I am using is: @media only screen and (max-width: 767px) { #block-yui_3_17_2_1_1705006258059_14874, #block-c84e76b20faf907912e8, { text-align: center !important; }} You can see in the screenshot, I'd like the Go-to and Contact text boxes to be aligned centrally on mobile only. On desktop I have one aligned to the left and one aligned to the right which I am happy with. Website: www.claretestar.com Dodger50! Thanks in advance Link to comment
Ziggy Posted March 7 Share Posted March 7 Try removing the unnecessary comma after the last block ID: @media only screen and (max-width: 767px) { #block-yui_3_17_2_1_1705006258059_14874, #block-c84e76b20faf907912e8 { text-align: center !important; } } 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
RebelRuth Posted March 12 Share Posted March 12 Hey @Ziggy Thanks for that - I've just tried that and sadly nothing has changed. Can you think of any other solutions? Best Ruth Link to comment
Ziggy Posted March 12 Share Posted March 12 18 minutes ago, RebelRuth said: Can you think of any other solutions? Slight adjustment: @media only screen and (max-width: 767px) { #block-yui_3_17_2_1_1705006258059_14874 .sqsrte-small, #block-c84e76b20faf907912e8 .sqsrte-small { text-align: center !important; } } RebelRuth 1 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
Ziggy Posted March 12 Share Posted March 12 11 minutes ago, RebelRuth said: @Ziggy THANK YOU!! It works!! 😀 Happy to help, can you give my post a like? RebelRuth 1 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
JimenaD Posted March 24 Share Posted March 24 Hello, I have tried the code in your comments but I can't make it work! Can you help me? I want to center the text block of the first two paragraphs (it's one block only). cryoheal.com.mx - Psw: javiykarla Link to comment
tuanphan Posted March 26 Share Posted March 26 On 3/24/2024 at 11:29 AM, JimenaD said: Hello, I have tried the code in your comments but I can't make it work! Can you help me? I want to center the text block of the first two paragraphs (it's one block only). cryoheal.com.mx - Psw: javiykarla You can use a CSS code like this @media screen and (max-width:767px) { div#block-40c409a322dac564a740 * { text-align: center !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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment