微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Lining.js

编程之家收集整理的这个编程导航主要介绍了Lining.js编程之家,现在分享给大家,也给大家做个参考。

Lining.js 介绍

在css中,我们使用 ::first-line 选择器来给元素第一行内容应用样式。但目前还没有像 ::nth-line、::nth-last-line 甚至 ::last-line 这样的选择器。实际上这期选择器在某些情况下是非常有用的,Lining.js 提供了这样的功能

Lining.js为您提供完整的DOWN-TO-THE-LINE控制,如下所示:

<div class="poem" data-lining>Some text...</div>

<style>

.poem .line[first] { /* `.poem::first-line`*/ }

.poem .line[last] { /* `.poem::last-line` */ }

.poem .line[index="5"] { /* `.poem::nth-line(5)` */ }

.poem .line:nth-of-type(-n+2) { /* `.poem::nth-line(-n+2)` */ }

.poem .line:nth-last-of-type(2n) { /* `.poem:::nth-last-line(2n)` */ }

</style>

<script src="YOUR_PATH/lining.min.js"></script>

网站地址:http://zencode.in/lining.js/

GitHub:https://github.com/zmmbreeze/lining.js

网站描述:让浏览器实现类似::nth-line(),::nth-last-line()的效果

Lining.js

官方网站:http://zencode.in/lining.js/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。