相關(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)糾紛中的來源非法是否有嚴(yán)格的司法定義?
- [確定有效] ECSHOP后臺(tái)登錄不了的問題解決 https打不開
- 免費(fèi)搜索代碼:如何利用百度做一個(gè)企業(yè)網(wǎng)站內(nèi)搜索?
- MySQL 中 HAVING 與 REPLACE 的用法解析
- 深入理解 MySQL 的連接操作:-h、-P、-u、-p 詳解
- 在 MySQL Workbench 中自定義導(dǎo)出文件格式的解決方案
html中div不自動(dòng)換行、強(qiáng)制不換行的具體實(shí)現(xiàn)
本文為大家介紹下html 中div不自動(dòng)換行的多種實(shí)現(xiàn),如可以使用nobr標(biāo)簽實(shí)現(xiàn)不換行,用nowrap元素等等,感興趣的朋友可以參考下
1.用<nobr>標(biāo)簽實(shí)現(xiàn)不換行
<div>Hello world!<nobr> Hello world!<nobr></div>
2.用<用nowrap元素>標(biāo)簽
<div nowrap>Hello world! Hello world! Hello world! Hello world!</div>
3強(qiáng)制不換行
div{
white-space:nowrap;
}
4.如果是兩個(gè)div,可使用float實(shí)現(xiàn)不換行
<div class="class1">hello </div>
<div class="class2">world! </div>
.class1 {float:left;}
5.在div中也可使用display實(shí)現(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元素>標(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;}
相關(guān)文章
- win7 64位 IIS7 IIS7.5 無法連接Access數(shù)據(jù)庫的問題解決
- 基于jQuery的上下無縫滾動(dòng)應(yīng)用(單行或多行)
- htaccess轉(zhuǎn)換httpd.ini方法及案例參考
- 網(wǎng)站偽靜態(tài)的優(yōu)缺點(diǎn)
- 高質(zhì)量的外部鏈接從何而來?
- SEO不能忽視外鏈建設(shè),更加要注重內(nèi)鏈建設(shè)
- 如何挑選合適的虛擬主機(jī)
- 網(wǎng)站建設(shè)的五個(gè)誤區(qū)
- php header 404跳轉(zhuǎn)錯(cuò)誤頁面的寫法
- 網(wǎng)頁嵌入百度地圖實(shí)例