两个::后伪元素 [英] Two ::after pseudo-elements

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

问题描述


可能重复:

在伪元素后添加伪元素

我想将两个css :: after 伪元素应用到单个DOM元素,每个元素都有不同的颜色。 (是的,我可以将DOM元素包装在另一个DOM元素中,并给出每个和 ::之后伪元素,但我的首选项是更清洁的html。)

I'd like to apply two css ::after pseudo-elements to a single DOM element, each with a different colour. (Yes, I could wrap the DOM element in another DOM element and give each one and ::after pseudo-element, but my preference is cleaner html.)

我怀疑是否可能,但想知道有人能更好地告诉我。

I doubt it's possible, but wonder if someone can tell me better.

我特别怀疑链接的可能性 :: after 伪元素在一起,使一个 ::后属于另一个,它属于一个DOM元素,

I especially doubt the possibility of chaining ::after pseudo-elements together so that one ::after pertains to another, which pertains to a DOM element, but if anyone knows how to make that happen, please do tell.

推荐答案

您可以使用:before code>:之后的code>伪元素 - http://jsfiddle.net/BePSq/

You can use a :before pseudo-element in addition to your :after - http://jsfiddle.net/BePSq/

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

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