人人人妻人人人妻人人人,99精品国产综合久久久久五月天 ,欧美白人最猛性XXXXX,日韩AV无码免费播放

News新聞

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

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

html中div不自動(dòng)換行、強(qiáng)制不換行的具體實(shí)現(xiàn)

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

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

 

1.用<nobr>標(biāo)簽實(shí)現(xiàn)不換行 

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

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

2.用<用nowrap元素>標(biāo)簽 

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

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

3強(qiáng)制不換行 

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

div{ 
white-space:nowrap; 

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

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

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

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

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

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