文本超过 显示 省略号

<!DOCTYPE html>
<html>

<head>

    <style>
        .div1 {
            height: 45px;
            line-height: 45px;
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
            width: 100px;
        }
    </style>
</head>

<body>
    <div class="div1">
        <span>
                asdfkjfdghkjlfdhjklhsjhjkashjkdfhjgk;saao;j
        </span>
    </div>
</body>

</html>
posted @ 2020-01-01 19:53  enych  阅读(121)  评论(0编辑  收藏  举报