相關(guān)關(guān)鍵詞
關(guān)于我們
最新文章
- ThinkPHP 5.1、6.0、6.1 與 8.0 版本對比分析
- 涉嫌侵權(quán)的人只復(fù)制了版權(quán)軟件,沒有傳播給其他人,是否符合復(fù)制侵權(quán)的判定?
- 網(wǎng)站域名備案到企業(yè)名下后,即表明是商業(yè)使用了嗎?
- 軟件中使用了GPL & MIT 協(xié)議的文件 和 使用了 GPL | MIT 的有什么區(qū)別?
- 網(wǎng)站版權(quán)糾紛中的來源非法是否有嚴格的司法定義?
- [確定有效] ECSHOP后臺登錄不了的問題解決 https打不開
- 免費搜索代碼:如何利用百度做一個企業(yè)網(wǎng)站內(nèi)搜索?
- MySQL 中 HAVING 與 REPLACE 的用法解析
- 深入理解 MySQL 的連接操作:-h、-P、-u、-p 詳解
- 在 MySQL Workbench 中自定義導(dǎo)出文件格式的解決方案
html中div不自動換行、強制不換行的具體實現(xiàn)
本文為大家介紹下html 中div不自動換行的多種實現(xiàn),如可以使用nobr標簽實現(xiàn)不換行,用nowrap元素等等,感興趣的朋友可以參考下
1.用<nobr>標簽實現(xiàn)不換行
<div>Hello world!<nobr> Hello world!<nobr></div>
2.用<用nowrap元素>標簽
<div nowrap>Hello world! Hello world! Hello world! Hello world!</div>
3強制不換行
div{
white-space:nowrap;
}
4.如果是兩個div,可使用float實現(xiàn)不換行
<div class="class1">hello </div>
<div class="class2">world! </div>
.class1 {float:left;}
5.在div中也可使用display實現(xiàn)不換行
<div class="class1">hello </div>
<div class="class2">world! </div>
.class1 {display:inline;}
.class2{display:inline;}
復(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;}