多个伪元素 [英] Multiple pseudo elements

查看:90
本文介绍了多个伪元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以像这样在一个对象中获取多个伪元素?

Is it possible to get multiple pseudo elements in one object just like these ones ?

div { content: 'A' }
div::before { content: 'B'; }
div::before(2) { content: 'C'; }
div::before(3) { content: 'D'; }

我在 http://jsfiddle.net/2mQpa/ 但不起作用

感谢

推荐答案

该语法来自旧的生成内容级别3模块。它不工作,因为没有人实现这个模块的任何部分,永远。事实上,由于缺乏兴趣和实现,规范本身已被放弃多年,并且挂起低优先级重写

That syntax is from the old Generated Content level 3 module. It doesn't work because nobody has implemented any part of this module, ever. In fact, the spec itself has been abandoned for years due to lack of interest and implementation, and is pending a low-priority rewrite.

即使这个功能是否会在重写后仍然存在,因为没有人愿意实现它。坦率地说,我不是抱着我的呼吸...

There is no telling even whether this feature will survive the rewrite because nobody's willing to implement it. And, frankly, I'm not holding my breath...

这里你唯一的解决方案是使用额外的标记,而不是伪元素,或找到一些其他的方式使用脚本生成该内容。

Your only solutions here are to use extra markup instead of pseudo-elements, or find some other way to generate that content using a script.

这篇关于多个伪元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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