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

css實(shí)現(xiàn)文本溢出顯示省略號(hào)

  發(fā)布時(shí)間:2014-12-23 17:02:39   作者:佚名   我要評(píng)論
這篇文章主要介紹了css實(shí)現(xiàn)文本溢出顯示省略號(hào)的方法和示例分享,推薦給大家。


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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML5標(biāo)簽</title>
<style>
p{
/**
white-space:nowrap;表示文本不會(huì)換行,在同一行繼續(xù),知道遇到
標(biāo)簽為止;
overflow:hidden;不顯示超過(guò)對(duì)象尺寸的內(nèi)容,就是把超出的部分隱藏了;
text-overflow:ellipsis;當(dāng)文本對(duì)象溢出是顯示...,當(dāng)然也可是設(shè)置屬性為clip不顯示點(diǎn)點(diǎn)點(diǎn);
-o-text-overflow:為了兼容opera瀏覽器;
*/
width:200px;
overflow:hidden;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
white-space:nowrap;
}
div{
/*文字超出高度不顯示*/
overflow:hidden;
display:block;
height:60px;
width:100px;
}
</style>
</head>
<body>
<p>這樣處理對(duì)搜索引擎更友好,因?yàn)闃?biāo)題實(shí)際上并未被截字,而是局限于寬度而未被顯示而已。</p>
<div>這樣處理對(duì)搜索引擎更友好,因?yàn)闃?biāo)題實(shí)際上并未被截字,而是局限于寬度而未被顯示而已。</div>
</body>
</html>

相關(guān)文章

最新評(píng)論