Jump to content

Place first desktop navigation menu button item to break on 2 lines instead of 3

Recommended Posts

Hello There

I have three words on my first header navigation item text on desktop, I used the code below to try and place the text on two lines  

So the first word on top and the last to words under but the code breaks the text on 3 lines because there are 3 words

could you please help me with a css code that places the first navigation text on 2 lines with the first word on top an the last 2 words under

thank you



/* PLACES FIRST HEADER ITEM button on THREE LINES AND ADJUSTS POSITION OF NAVIGATION TO ALIGN THE BOTTOM OF FIRST BUTTON*/
.header.header-nav-item a{
max-width:177px;
}
.header-nav-item:nth-child(1){
white-space:normal;text-align:left; padding-left:.90rem; padding-left:.210rem
}.header-nav-item, .user-accounts-text-link, .cart-text-link {
line-height: 8.1em;
}

Link to comment
  • Replies 1
  • Views 230
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Quote

could you please help me with a css code that places the first navigation text on 2 lines with the first word on top an the last 2 words under

CSS doesn't have selectors to address individual words.

What you can do is run some JavaScript that would wrap the words in span tags which would then allow you to write CSS that can target the words.

I've done a couple of similar pieces of code recently.

I might be able to get something going for your need.

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

If your site is not public please set up a site-wide password, if 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 documentation at the link provided to understand how it works.

Please read the documentation at the link provided on how to share a link to your site to understand how it works. A link to the backend of the your site won’t work for us, i.e. a url that contains /config/.

We can then take a look at your issue.

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.