redconservatory
redconservatory

Reputation: 21934

css: stop words from flowing to another line without a non-breaking space?

Is there a way to make links where the text does not flow to the next line without putting in non-breaking spaces in between the words?

I need to be able to set the width: auto on the link also.

<ul>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">keep all words on the same line</a></li>
<li><a href="#">link</a></li>
</ul>

Upvotes: 0

Views: 627

Answers (1)

ScottS
ScottS

Reputation: 72281

use the following:

a { white-space: nowrap;}

Upvotes: 6

Related Questions