选择< p>的最后一行元件 [英] Selecting the last line of a <p> element
本文介绍了选择< p>的最后一行元件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道CSS中的:一行
选择器,但我找不到任何可以选择最后一行的选项。
我试图选择最后一行的原因是因为我想能够定义 我试图避免使用JavaScript来形成一个解决方案。 text-overflow
和
解决方案
我不认为这可以用CSS单独完成。 jQuery或PHP函数可能能够得到你
I am aware of the :first-line
selector in CSS, but I cannot find anything that will allow me to select the last line.
The reason I am trying to select the last line is because I want to be able to define the text-overflow
and white-space
attributes of the last line.
I am trying to avoid using JavaScript to form a solution.
解决方案
I don't think this can be done with CSS alone. jQuery or a PHP function might be able to get want you what
这篇关于选择< p>的最后一行元件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文