本文所分享的知识点是【div 溢出隐藏 div文字溢出用点(省略号)代替】,欢迎您喜欢我爱IT技术网所分享的教程、知识、经验或攻略,下面是详细的讲解。
div 溢出隐藏 div文字溢出用点(省略号)代替
[html]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh" lang="zh">
<head profile="http://www.w3.org/2000/08/w3c-synd/#">
<meta http-equiv="content-language" content="zh-cn" />
<meta http-equiv="content-type" content="text/html;charset=gb2312" />
<title>div中溢出文字用点代替的代码</title>
<style type="text/css">
li {
width:200px;
white-space:nowrap;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
overflow: hidden;
}
</style>
</head>
<body>
<ul>
<li><a href="http://www.jb51.net/css/69034.html#">web标准常见问题大全web标准常见问题大全</a></li>
<li><a href="http://www.jb51.net/css/69034.html#">web标准常见问题大全web标准常见问题大全</a></li>
<li><a href="http://www.jb51.net/css/69034.html#">web标准常见问题大全web标准常见问题大全</a></li>
<li><a href="http://www.jb51.net/css/69034.html#">web标准常见问题大全web标准常见问题大全</a></li>
<li><a href="http://www.jb51.net/css/69034.html#">web标准常见问题大全web标准常见问题大全</a></li>
</body>
</html>
[/html]
关于div 溢出隐藏 div文字溢出用点(省略号)代替的相关讨论如下:
相关问题:div内多行文字, 溢出部分用省略号显示
答:在CSS样式中加入 width:100px; //你所要的宽度white-space:nowrap; text-overflow:ellipsis; -o-text-overflow:ellipsis; overflow: hidden; >>详细
相关问题:div内文字显示两行,超出两行部分省略号显示css能...
答:通常的做法是这样的: 1.overflow:hidden; 2.text-overflow:ellipsis; 3.-o-text-overflow:ellipsis; 4.white-space:nowrap; 5.width:100%; 其中,overflow: hidden和white-space: nowrap都是必须的否则不会显示省略号;-o-text-overflow: ellip... >>详细
相关问题:div溢出隐藏
答:如果你知道你要隐藏的部分的高度的话,比如100px,可以设置margin-top: -100px; 下面使用图片做的个例子: >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
