1. 首页>>前端>>CSS

css超出隐藏并用...表示

<div class="tetx1">
	<p>我是能看见的部分,如果我足够长,那么我后面的字就会被隐藏</p>
</div>

<style>
	.tetx1 p{
		width: 288px;
		height: 30px;
		overflow: hidden;          /* 超出部分隐藏 */
		text-overflow: ellipsis;  /* 超出用...表示 */
		white-space: nowrap;     /* 超出部分是否换行 */
	}
</style>


转载联系作者并注明出处:https://focusonseo.cn/cassas/108.html