theuq Posted October 30, 2023 Share Posted October 30, 2023 Hey everyone! I am trying to align the text for one of the pages to the centre on mobile only using the page collection ID but it isn't working correctly it also targets other pages like the blog posts, so I'm not sure why. @media screen and (max-width: 767px) { #collection-64cffc9994e65d76b69494af h1, h2, h3, h4, p { text-align: center !important; }} Many thanks! Link to comment
Ziggy Posted October 30, 2023 Share Posted October 30, 2023 Your code is very slightly wrong, try this correction: @media screen and (max-width: 767px) { #collection-64cffc9994e65d76b69494af { h1, h2, h3, h4, p, .sqsrte-large, .sqsrte-small { text-align: center !important; } } } Let me know if that works for you! theuq 1 Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲 SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
theuq Posted October 30, 2023 Author Share Posted October 30, 2023 Ah, thank you, Ziggy! That worked! Can you please explain why we'd have to use the following code? .sqsrte-large, .sqsrte-small Link to comment
Ziggy Posted October 30, 2023 Share Posted October 30, 2023 1 hour ago, theuq said: Can you please explain why we'd have to use the following code? .sqsrte-large, .sqsrte-small This is targeting the Paragraph 1 and Paragraph 3 font sizes. theuq 1 Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲 SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
theuq Posted November 3, 2023 Author Share Posted November 3, 2023 Ah okay! Thank you! Link to comment
Ziggy Posted November 3, 2023 Share Posted November 3, 2023 p1 p2 p3 for the paragraphs would be easier to understand (and remember when coding!) Oh well! theuq 1 Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲 SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
theuq Posted November 3, 2023 Author Share Posted November 3, 2023 Yeah, that's what I was trying to do with p1 etc. but didn't work. 🫣 Link to comment
theuq Posted November 25, 2023 Author Share Posted November 25, 2023 @Ziggy Sorry to bother you about it but I noticed that the text in the footer also comes center-aligned for that one page. Is there any way we can keep the highlighted text left-aligned? I've tried the below code and a few iterations but that didn't work. @media screen and (max-width: 767px) { section[data-section-id="64cfffb4aae68f02a5739844"] { text-align: left !important; } } Link to comment
Solution tuanphan Posted November 27, 2023 Solution Share Posted November 27, 2023 You can adjust Ziggy code to this, to exclude Footer content from the code @media screen and (max-width: 767px) { #collection-64cffc9994e65d76b69494af article { h1, h2, h3, h4, p, .sqsrte-large, .sqsrte-small { text-align: center !important; } } } Ziggy 1 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
theuq Posted November 28, 2023 Author Share Posted November 28, 2023 Thank you @tuanphan! That worked! tuanphan 1 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