Jump to content

Word splitting

Go to solution Solved by Ziggy,

Recommended Posts

Hi, I've added some CSS to allow a font to appear differently on my site: www.nickpointon.co.uk

However, at smaller mobile screen sizes the word Graphic Designer starts to split allowing the 'r' of Designer to flow onto the next line for example. 

How can I make sure that the word does not split? 

Here is the code I'm currently using, I thought that using 'word-wrap: keep-all;' would make sure the word doesn't split but it's not working. Any suggestions would be greatly appreciated. 

Cheers,

Nick



.Marquee * {
  color: white;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke-width: 1.2px;
  -webkit-text-stroke-color: white;
font-family: Obviously wide bold;
font-style: normal;
font-weight: normal;
word-wrap: keep-all;
//  font-size: 60px;
//letter-spacing: 0.5rem;
}

// Mobile H1 text size //
@media screen and (max-width:750px) 
{ h1 {font-size: 35px;
  line-height: 46px;
overflow-wrap: keep-all;
    }}

@media screen and (max-width:750px) 
{ h2 {font-size: 30px;
  line-height: 40px;
  word-wrap: keep-all;
    }}


h1 em strong,
h1 strong em {
  color: white;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke-width: 1.2px;
  -webkit-text-stroke-color: white;
  font-size: 60px;
letter-spacing: .2rem;
 font-family: Obviously-wide;
  font-style: normal; /*if you want to remove the italics*/
  font-weight: normal; /*if you want to remove the bold style*/
  //text-transform: uppercase; /*if you want to remove the all uppercase or lowercase style*/
@media screen and (max-width:750px) {
  font-size: 48px;
word-wrap: keep-all;
}
}

Link to comment
  • Solution

I would suggest using 12vw instead of 48px on @media screen and (max-width:750px) maybe also adjust the 750px to 767px since that's the breakpoint.

and then add another media query before the 750px, something like this:

@media only screen (min-width:768px) and (max-width:900px) {
  font-size:54px;
}

That's should have you covered.

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) 

 Did I help? Buy me a coffee?

Link to comment

Happy to help! Could you mark my post as the solution thanks!

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) 

 Did I help? Buy me a coffee?

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.