lamdra Posted October 20, 2021 Posted October 20, 2021 I'm using the following code to add a highlight to my h2 when bolded but the highlight is abrupt when the line breaks in mobile or smaller browser size. Is there a better way to do this so that the highlight feels more like a background around all letters with equal space? h2 strong { background: #1b1b1a; padding-top: 7px; padding-bottom: 7px; font-weight:normal !important; } URL: https://cantina-loca.squarespace.com/ Password: 8989
Beyondspace Posted October 20, 2021 Posted October 20, 2021 9 hours ago, lamdra said: I'm using the following code to add a highlight to my h2 when bolded but the highlight is abrupt when the line breaks in mobile or smaller browser size. Is there a better way to do this so that the highlight feels more like a background around all letters with equal space? h2 strong { background: #1b1b1a; padding-top: 7px; padding-bottom: 7px; font-weight:normal !important; } URL: https://cantina-loca.squarespace.com/ Password: 8989 It seems that you 've solved your issue on your own, doesn't it? BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> 🤖 Ask me anything
lamdra Posted October 20, 2021 Author Posted October 20, 2021 4 minutes ago, bangank36 said: It seems that you 've solved your issue on your own, doesn't it? No, I haven't actually. I worked around it for now by doing a hard return and adding a space before the line. But that's not ideal. Do you know how I can fix this without the forced return?
lamdra Posted October 20, 2021 Author Posted October 20, 2021 2 hours ago, lamdra said: No, I haven't actually. I worked around it for now by doing a hard return and adding a space before the line. But that's not ideal. Do you know how I can fix this without the forced return? Still happens on longer headlines where I can't control the line breaks.
tuanphan Posted October 22, 2021 Posted October 22, 2021 8989 Incorrect password. Can you check it again? 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!)
lamdra Posted October 27, 2021 Author Posted October 27, 2021 On 10/22/2021 at 4:29 AM, tuanphan said: 8989 Incorrect password. Can you check it again? site is live now at cantinaloca.com. Would love to help resolve this issues. Thanks for looking!
lamdra Posted October 28, 2021 Author Posted October 28, 2021 On 10/22/2021 at 4:29 AM, tuanphan said: 8989 Incorrect password. Can you check it again? @bangank36 @tuanphan Any thoughts? Site is no longer password protected. You can recreate the issue on mobile version of this pagehttps://www.cantinaloca.com/our-story Thanks for your help!
tuanphan Posted October 31, 2021 Posted October 31, 2021 On 10/28/2021 at 10:30 AM, lamdra said: @bangank36 @tuanphan Any thoughts? Site is no longer password protected. You can recreate the issue on mobile version of this pagehttps://www.cantinaloca.com/our-story Thanks for your help! How do you want the text to appear on the desktop-tablet-mobile? 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!)
lamdra Posted November 1, 2021 Author Posted November 1, 2021 On 10/30/2021 at 7:37 PM, tuanphan said: How do you want the text to appear on the desktop-tablet-mobile? I'd like there to be padding on the left of the text when it drops down a line. The way "Call Loca" looks is what I'm after but unless I manually add a return and a space I can't get it. For example what you see before "Time" is what it looks like if it just automatically drops a line in smaller screens. Is there a way to keep that left padding even when the sentence breaks into multiple lines?
reubenc Posted April 4 Posted April 4 I know this is an old thread, but I recently ran into a similar situation and came across this post while I was looking for a solution. I found something that worked for my situation by including the following css attributes I found on this article: https://dev.to/nhuynh1/highlighter-effect-adding-box-decorations-like-padding-to-inline-elements-that-wrap-onto-multiple-lines-10ip. Hope you find it useful! { box-decoration-break: clone; -webkit-box-decoration-break: clone; } I tested out this solution on your site and see if it would work. While looking at it, I noticed a lot of the css is missing semicolons after a lot of attributes. Don't know if this is a Squarespace issue or not, since I have not worked with their builder. There were also an element style I needed to remove in order to make the spacing even for all sides as well. These were my changes: h2 strong { background: #1b1b1a; padding-top: 6px; padding-bottom: 6px; font-weight: normal !important; padding-left: 30px; padding-right: 30px; box-decoration-break: clone; -webkit-box-decoration-break: clone; } h2 element style attribute { text-align: center; /* white-space: pre-wrap; */ } Note missing line numbers and semicolons in original css on the left. Site unchanged - no padding on headline lines 2 and 3. Addition of box-decoration-break - padding now visible on headlines 2 and 3, but greater on line 1 left & right, and on line 2 right only. Removal of h2 element style attribute white-space: pre-wrap - padding now even on all lines.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment