zsharp
zsharp

Reputation: 13756

Stop wrapping of hyphenated text?

I have a bunch of links in a div. Some have format "some-name". those with hyphen will split and wrap. I would like it to start a new line. How to do this please?

Upvotes: 14

Views: 6695

Answers (5)

cssyphus
cssyphus

Reputation: 40038

You can also do this:

<nobr>Table-text</nobr>

Reference:

How to prevent line break at hyphens on all browsers

Upvotes: -1

Ben James
Ben James

Reputation: 125167

You can use a non-breaking hyphen character, &#8209;

Upvotes: 23

dar7yl
dar7yl

Reputation: 3747

turn off formatting with

<pre>...</pre>

Upvotes: 0

Chris Fulstow
Chris Fulstow

Reputation: 41882

<span style="white-space: nowrap;">some-name</span>

Upvotes: 6

Nicolas Goy
Nicolas Goy

Reputation:

You can use the CSS attribute: white-space:nowrap; But note that it is not working all the time on some browser.

The other option is to wrap your link into a <pre> element but this approach can have some side effects as well.

Upvotes: 13

Related Questions