Skip to content Skip to sidebar Skip to footer

Can I Stop Two Words From Breaking Onto Separate Lines And Creating An Orphan?

I have a paragraph that ends with a link that contains the two word phrase 'Read More'. I'd like these two words to always be displayed on the same line. Right now, if the 'More' c

Solution 1:

There's a <nobr> tag in HTML that will do this, but it's deprecated. This page suggests using white-space:nowrap instead.

white-space is defined in the CSS1 specification and should be supported by all major browers.

Solution 2:

You can also place the non-breaking space between the two words:

Read&nbsp;More

although arguably this muddies HTML with presentation matters.

Solution 3:

<a href='#'class="my-readmore-css-class">Read more</a>

.my-readmore-css-class { white-space:nowrap; } // it should be style for your "Read more"

Post a Comment for "Can I Stop Two Words From Breaking Onto Separate Lines And Creating An Orphan?"