欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

  發(fā)布時間:2014-01-26 17:49:21   作者:佚名   我要評論
本文為大家介紹下html 中div不自動換行的多種實現(xiàn),如可以使用nobr標(biāo)簽實現(xiàn)不換行,用nowrap元素等等,感興趣的朋友可以參考下
1.用<nobr>標(biāo)簽實現(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強制不換行

復(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;}

相關(guān)文章

最新評論