Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

How to keep padding on heading text highlight when line breaks


lamdra

Question

 

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

1856486637_ScreenShot2021-10-20at12_52_15AM.thumb.png.a6ae41ca8349392f1d76eb61512835b6.png

Link to comment
  • Answers 8
  • Created
  • Last Reply

Top Posters For This Question

8 answers to this question

Recommended Posts

  • 0
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

1856486637_ScreenShot2021-10-20at12_52_15AM.thumb.png.a6ae41ca8349392f1d76eb61512835b6.png

It seems that you 've solved your issue on your own, doesn't it?

image.png.b449d66d7df8e50645db90bd42a18002.png

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Youtube Gallery for Squarespace
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
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?

Link to comment
  • 0
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.

1574470603_ScreenShot2021-10-20at2_00_44PM.thumb.png.436f66e7d7c2de771f5a78768221619b.png

Link to comment
  • 0
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!

Link to comment
  • 0
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 page

https://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.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 0
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?

Screen Shot 2021-10-20 at 2.00.44 PM.png

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...