Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop word-wrap in html

Tags:

I don't want word wrap but this is being. I have set width more than text length but this is still breaking so how can I stop word break.

css

.menu{     float:left;     width:120px;     height:34px;     padding:12px 6px 0 6px;     color:#cc8d50;  } 
like image 774
Kali Charan Rajput Avatar asked Sep 07 '10 12:09

Kali Charan Rajput


People also ask

How do I make text not wrap around an image in HTML?

You'll have to wrap your text in its own container. Since your <img> is floated to the left, you can use overflow: hidden on your newly-added container to achieve no wrapping of the text.

Which tag is used to turn off the word wrapping?

Word Wrapping Netscape includes two tags: <NOBR>... </NOBR>, and <WBR>. The former turns off wordwrapping between the start and end NOBR tag, while WBR is for the rare case when you want to specify where to break the line if needed.

How do I remove a word break in CSS?

You need to use the CSS white-space attribute. In particular, white-space: nowrap and white-space: pre are the most commonly used values.


2 Answers

Try:

.menu{     white-space: nowrap; ... 

Add that to your CSS.

like image 115
Kyle Avatar answered Sep 28 '22 02:09

Kyle


In your css insert this:

white-space:nowrap; 
like image 44
mkoistinen Avatar answered Sep 28 '22 04:09

mkoistinen