Using HTML in CSS After Tag for Hover State

佐手、 提交于 2020-01-14 08:54:07

问题


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!


回答1:


You need to use the hex value \00BB.

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




回答2:


You're looking for, I think:

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

JS Fiddle demo

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



来源:https://stackoverflow.com/questions/5226764/using-html-in-css-after-tag-for-hover-state

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