How to prevent line breaks in list items using CSS

Issue

I’m trying to put a link called Submit resume in a menu using a li tag. Because of the whitespace between the two words it wraps to two lines. How to prevent this wrapping with CSS?

Solution

Use white-space: nowrap;[1] [2] or give that link more space by setting li‘s width to greater values.


[1] ยง 3. White Space and Wrapping: the white-space property – W3 CSS Text Module Level 3
[2] white-space – CSS: Cascading Style Sheets | MDN

Answered By – n1313

Answer Checked By – Pedro (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.