美文网首页
css实现多行超出省略

css实现多行超出省略

作者: 枣阳黄小明 | 来源:发表于2021-07-29 10:26 被阅读0次
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        div{
            width: 250px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical; 
            word-break: break-all;       
        }
    </style>
</head>
<body>
    <div>
        111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
    </div>
</body>
</html>

效果图


image.png

相关文章

网友评论

      本文标题:css实现多行超出省略

      本文链接:https://www.haomeiwen.com/subject/vfhbzhtx.html