Fork me on GitHub

CSS 溢出文本

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>溢出文本</title>
    <style>
        dl{
            width:240px;
            border:solid 1px #ccc;
        }
        dt{
            padding:8px 8px;
            font-size: 13px;
            text-align: left;
            font-weight: bold;
            color:#71790C;
            margin-bottom: 12px;
            border-bottom: solid 1px #efefef;
        }
        dd{
            font-size: 0.78em;
            height:1.5em;
            width:220px;
            padding:2px 2px 2px 18px;
            margin:2px 0;
            /*主要作用*/
            white-space: nowrap;
            overflow: hidden;
            -o-text-overflow: ellipsis;
            text-overflow: ellipsis;
            -moz-bingding:url('ellipsis.xml#ellipsis');

        }
    </style>
</head>
<body>
    <dl>
        <dt>收藏新闻</dt>
        <dd>钱币|5ku司彩银虎币价值几何 三连8豹子钞市值达千元</dd>
        <dd>海外|英国美术馆办窥视模特洗澡展 探秘荷兰人体博物馆</dd>
        <dd>藏界|地产商谈收藏:跟拿地异曲同工 拾垃圾的老外</dd>
    </dl>
</body>
</html>

 

posted @ 2020-12-20 10:30  HelloLLLLL  阅读(96)  评论(0编辑  收藏  举报