Multiple pseudo elements

独自空忆成欢 提交于 2019-12-08 16:47:41

问题


Is it possible to get multiple pseudo elements in one object like this?

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

I have tried it but it doesn't work.


回答1:


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.



来源:https://stackoverflow.com/questions/13465817/multiple-pseudo-elements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!