Preventing word break between units and values

Posted in: Newspaper
Post count: 80

Hey there,

as the title suggests, is it possible for me to achieve this?

For Example: 9,99999999 km……

Do take note:
When screen size changes, units and values as the example above, would be broken as a normal sentence.
Can I prevent it, such that the units and values ‘9,99999999 km’ sticks, no matter even if there are ‘spaces’ inbetween them?

Post count: 23312

Hello leapdsc,

You should provide some useful screenshot with the problem so I can identify it. Also, please notice that thing is not theme related. Itțs just WordPress related. For more information about this case, you should consult the following guides, here -> http://www.omnicode.com/qa.php?id=113 -> https://css-tricks.com/forums/topic/prevent-word-breaks/ -> http://www.zaposphere.com/remove-auto-hyphenation-in-wordpress/
If is not what you mean, please provide more details so I will be able to provide a more accurate response.

Thanks for your understanding!

Post count: 9544

Have you tried normal nonbreaking spaces in your HTML ?

You can also create CSS to keep elements together and apply that as a span.

We did that back in 2013 with our main site redesign to ensure our toll free number didn’t wrap on Boostrap section collapse on mobile.

Post count: 9544

I think the css to make a nowrap span is
.nowrapit{white-space: nowrap;}

I have a barrel of monkeys <span class="nowrapit">99,9999 km</span> ...

Post count: 80

Hi Chris S,

I have tried your suggested method and it works exactly how I want it!
Thanks a bunch. Really appreciated the help!

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.