简体   繁体   中英

Why does :before only seem to work once in my code?

I am using :before to display webfont icons before menu items. For some reason :before is only working on one class and is completely ignoring the other class. If I change both classes on the two li's that should have icons before them to the working class name, the icon shows up.

Ideas?

Here is an example: http://jsfiddle.net/bigdmachine/erxjE/1/

I'd rather update the CSS to;

nav#al-top-menu .log-out a:before, 
nav#al-top-menu .setting a:before {
     content: "X";
     margin-left: 15px;
     margin-right: 5px;    
     font-family: 'WebSymbolsRegular';
     font-size: 14px;
     color: blue;

}

我认为您不能像这样在<ul>内创建“免费”伪元素,列表应仅包含列表项。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM