小编Jas*_*son的帖子

CSS:如何使用"..."限制显示的文本

可能重复:
是否可以使用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 css web-applications trim

11
推荐指数
0
解决办法
7万
查看次数

CSS:垂直对齐文本?

我使用以下HTML:

<p><a href="http://www.example.com/">&larr; Back</a></p>
Run Code Online (Sandbox Code Playgroud)

要创建以下内容:

←返回

问题是,左箭头没有在中间垂直对齐.它似乎处于较低的第3位.

问题:如何使用CSS使左箭头在中间(字母"B")垂直对齐?


更新:

我可以垂直调整/对齐这个:

  1. 不修改我的HTML,和
  2. 没有使用图像?

html css

4
推荐指数
1
解决办法
3824
查看次数

标签 统计

css ×2

html ×2

trim ×1

web-applications ×1