html code
<p class="mi">当文字超过范围的时候,超出部分会隐藏起来。</p>
css code
.mi { width: 200px; overflow: hidden; text-overflow: ellipsis; white-space:nowrap; }
Result
html code
<p class="mi">当文字超过范围的时候,超出部分会隐藏起来。可以设置第几行开始隐藏。</p>
css code
.mi { width: 200px; overflow: hidden; display: -webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
result
The above is the detailed content of In-depth understanding of css styles beyond hiding summary. For more information, please follow other related articles on the PHP Chinese website!