我的 CSS:
#content_right_head span { display:inline-block; width:180px; overflow:hidden !important; }
现在它正在显示 内容内容
但我想显示喜欢的 内容内容......
我需要在内容之后显示点。内容来自数据库动态。
为此,您可以使用text-overflow: ellipsis;属性。像这样写
text-overflow: ellipsis;
span { display: inline-block; width: 180px; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis; } <span>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</span>
JSFiddle