解决标题过长的CSS

不知道为什么大家用截取字符串的人很多呢。。

<html>
<head>
<style type="text/css">
.divout {
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    width: 100%;
    overflow: hidden;
    -ms-text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    -webkit-text-overflow: ellipsis;
    text-overflow: ellipsis;
}
</style>

</head>
<body>
<div class="divout" style="width:100px;">
源码爱好者为您提供精品的网页特效、网页教程,还有面向初学者的各类编程代码,助您早日成功编程高手。
</div>
</body>
</html>

多好用的代码,IE 谷歌全兼容。。

 

posted @ 2014-08-18 10:16  jgjg2323  阅读(228)  评论(0编辑  收藏  举报