在 CSS 中使用 HTML 在标记后的悬停状态

2022-01-22 00:00:00 hover html css pseudo-class

我目前正在尝试将一些 html 传递到 css 中的 :after 伪类中,以便在链接悬停后添加一个箭头.我已经在很久以前在默认安装附带的库存 WordPress 主题中看到了这一点.我觉得我必须错过一些简单的东西.

I am currently trying to pass in some html into the the :after pseudo class in css to add an arrow after a link once hovered on. I have seen this done quite some time ago in the stock WordPress theme that used to ship with the default install. I feel like I must me missing something simple.

a:hover:after{content: "»"}  

提前致谢!

推荐答案

需要使用十六进制值0BB.

http://jsfiddle.net/durilai/AGDbH/

相关文章