Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 省略号对几个词不起作用_Css - Fatal编程技术网

Css 省略号对几个词不起作用

Css 省略号对几个词不起作用,css,Css,我有以下css的省略号。它只适用于少数文本。但对于少数文本,它不起作用 注意-这是两行的 请帮忙 .myclass { max-width: 210px; width: 290px; height: 3em; min-height: 3em; overflow: hidden; text-overflow: ellipsis; overflow: hidden; display: block; } 使用以下代码 <

我有以下css的省略号。它只适用于少数文本。但对于少数文本,它不起作用

注意-这是两行的 请帮忙

.myclass {
    max-width: 210px;
    width: 290px;
    height: 3em;
    min-height: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow: hidden;
    display: block;     
}
使用以下代码

 <div class="myclass">Lorem Ipsum is simply dummy text of the printing and 
   typesetting industry.</div>
<style>
    .myclass {
        max-width: 250px;
        min-height: 3em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
</style>
Lorem Ipsum只是印刷和印刷的虚拟文本
排版业。
.myclass{
最大宽度:250px;
最小高度:3em;
溢出:隐藏;
文本溢出:省略号;
空白:nowrap;
}

你能制作代码片段吗?“它对少数文本有效。但对少数文本无效。”没有任何意义,因为我的文本都很长。当它转到第二行时,省略号不起作用。也许你应该试试这个。。。