国产精品成人VA在线观看,亚洲日韩在线中文字幕综合,亚洲AV电影天堂男人的天堂,久久人人爽人人爽人人av东京热

News新聞

業(yè)界新聞動態(tài)、技術(shù)前沿
Who are we?

您的位置:首頁      網(wǎng)站知識      html中div不自動換行、強制不換行的具體實現(xiàn)

html中div不自動換行、強制不換行的具體實現(xiàn)

標簽: 發(fā)布日期:2014-02-13 00:00:00 2761

本文為大家介紹下html 中div不自動換行的多種實現(xiàn),如可以使用nobr標簽實現(xiàn)不換行,用nowrap元素等等,感興趣的朋友可以參考下

 

1.用<nobr>標簽實現(xiàn)不換行 

復(fù)制代碼
代碼如下:

<div>Hello world!<nobr> Hello world!<nobr></div> 

2.用<用nowrap元素>標簽 

復(fù)制代碼
代碼如下:

<div nowrap>Hello world! Hello world! Hello world! Hello world!</div> 

3強制不換行 

復(fù)制代碼
代碼如下:

div{ 
white-space:nowrap; 

4.如果是兩個div,可使用float實現(xiàn)不換行 

復(fù)制代碼
代碼如下:

<div class="class1">hello </div> 
<div class="class2">world! </div> 
.class1 {float:left;} 

5.在div中也可使用display實現(xiàn)不換行 

復(fù)制代碼
代碼如下:

<div class="class1">hello </div> 
<div class="class2">world! </div> 
.class1 {display:inline;} 
.class2{display:inline;}