可能重复:
是否可以使用javascript或css实现overflow:省略号的效果?
如何使用CSS将长文本指定到较小的固定列中?
我希望修剪文本,如果它大于300px宽,带"......"
例如,如果我有:
<ul>
<li>this is greater than 300px, than only display as much of the text that is 300px wide and then replace the remaining text with "..."</li>
<li>short, don't trim</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
将显示为:
this is greater than 300px, than only ...
short, don't trim
|----------- 300px wide ----------------|
Run Code Online (Sandbox Code Playgroud)
我如何用CSS/HTML做到这一点?
我使用以下HTML:
<p><a href="http://www.example.com/">← Back</a></p>
Run Code Online (Sandbox Code Playgroud)
要创建以下内容:
问题是,左箭头没有在中间垂直对齐.它似乎处于较低的第3位.
问题:如何使用CSS使左箭头在中间(字母"B")垂直对齐?
更新:
我可以垂直调整/对齐这个: