Jump to content

Controlling location of line breaks for adaptive design?

Recommended Posts

Is there a way to control where in a line of text the break(s) occur when the design adapts for screen/device? In my case, I have a single line for my business address, when viewed on a computer, but on a phone, it breaks into multiple lines, but in unpredictable places, so it's somewhat unreadable as an address, i.e. the name of the firm, the street number, then a line break followed by the street name, etc. Thoughts? Thanks in advance!

Link to comment
  • Replies 3
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

Please post the URL for a page on your site where we can see your issue.

A link to the backend of the your site won’t work for us, i.e. a url that contains /config/.

Please set up a site-wide password, if your site is not public and you've not already done so.

Post the password here.

Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site.

Please read the site-wide password and how to share a link documentation to understand how they work.

We can then take a look at your issue.

You may find How to post a forum question post useful.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Where lines break can be tricky. There is no CSS to address words individually or in groups. That part is left to HTML.

I can see two ways to go. You can use two sets of text blocks one for desktop display and one set for mobile. Then show/hide those block sets depending on viewport size.

So for example. On desktop you'd have one block...

SAN ANSELMO, CALIFORNIA 94960

...and then a second block...

SAN ANSELMO,
CALIFORNIA 94960

...and the use the CSS show/hide method I mentioned.

Alternately you could dump the text blocks and use code blocks to get more control over how the text is breaking.

<p style="text-align : center;">

  <span style="white-space : nowrap;">
  
    SAN ANSELMO,</span>
    
  <span style="white-space : nowrap;">
  
    CALIFORNIA 94960
    
    </span>
    
  </p>

The top text is a code block.

ScreenShot2023-08-04at12_31_40PM.png.3d21c29a33506ff5705bae1dc5d0b854.png

These techniques are not guaranteed to fix your word wrapping issue but should give a bit more control.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.