超出文字出现省略号不换行

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>text</title>
</head>
<style>
    
    .text{
      width:100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
</style>
<body>
    <div style="width:200px">
        <p class="text">20-78-90-7620-78-90-7620-78-90-7620-78-90-7620-78-90-7620-78-90-7620-78-90-7620-78-90-7620-78-90-7620-78-90-7620-78-90-7620-78-90-7620-78-90-7620-78-90-7620-78-90-76</p>
    </div>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/liujiale/p/10937360.html