选择 <p> 的最后一行元素 [英] Selecting the last line of a <p> element

查看:44
本文介绍了选择 <p> 的最后一行元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 CSS 中的 :first-line 选择器,但我找不到任何可以让我选择最后一行的东西.

I am aware of the :first-line selector in CSS, but I cannot find anything that will allow me to select the last line.

我试图选择最后一行的原因是因为我希望能够定义最后一行的 text-overflowwhite-space 属性.

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.

我试图避免使用 JavaScript 来形成解决方案.

I am trying to avoid using JavaScript to form a solution.

推荐答案

我不认为这可以单独使用 CSS 来完成.jQuery 或 PHP 函数可能会想要你什么

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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆