Using HTML in CSS After Tag for Hover State

2019-06-19 17:51发布

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: "»"}  

thank in advance!

2条回答
迷人小祖宗
2楼-- · 2019-06-19 18:18

You need to use the hex value \00BB.

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

查看更多
We Are One
3楼-- · 2019-06-19 18:20

You're looking for, I think:

a:hover:after
{
content: "\00bb";
}

JS Fiddle demo

Link to reference: http://css-tricks.com/snippets/html/glyphs/

查看更多
登录 后发表回答