CSS截取字符串,超出用省略号代替,兼容火狐和IE各版本(转载http://www.365css.cn/post/746.html)

 

<style type="text/css">
body{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
}
div{
    width:200px;
    height:24px;
    line-height:24px;
    overflow:hidden;
    border:#ccc solid 1px;
    background-color:#F9F9F9;
    margin:5px;
}
div a{
    color:#000;
    display:block;
    padding-right:7px;
    background:url(http://www.365css.cn/example/ellipsis_365css.cn/ellipsis.gif) no-repeat right bottom;
}
</style>

<div><a href="#">CSS截取字符串,超出用省略号代替</a></div>
<div><a href="#">CSS截取字符串,并将超出用省略号代替</a></div>
<div><a href="http://www.365css.cn" target="_blank">365CSS</a></div>
<div><a href="http://www.kanshula.com.cn" target="_blank"><span>http://www.kanshula.com.cn看书啦小说网</span></a></div>
posted @ 2010-01-13 15:10  kuncai  阅读(1446)  评论(0编辑  收藏  举报