0

我使用无序列表创建了一个导航栏。这是我的问题:

我无法更改列表项文本的颜色,并且由于某种原因我无法再单击我的链接(我之前在开发中能够单击它们,不知道它们何时停止工作)。

以下是这些物品现在的样子:

http://gyazo.com/c089ed3f21368d4d2a1d91a52e129222.png

HTML:

<div class="grid_16 alpha" id="header">
    <ul id="nav" class="grid_4 prefix_1">
        <li id="nav_home"><a href="#">Home</a></li>
        <li id="nav_home"><a href="#">News</a></li>             
    </ul>
</div>

CSS:

#nav {
    color:white;
    margin-top: 54px;
}

#nav li {
    color: white;
    display: inline;        
}

#nav a:link {
    font-family: ColaborateThinRegular; 
    font-size: 18px;
    text-decoration: none;
    background-color: #353535;
    padding: 5px 20px;
    margin-right: 15px; 
    color: white;
    box-shadow: 1px 1px 3px #000;   
}
4

2 回答 2

0

Found it:

look at this jsFiddle. the problem with the coloring occured because you didn't specify a:visited as well as a:link so the color was purple.

The non-clickable problem.. has something to do with href="#" or some other code on your site that prevents it.. I've linked one of the buttons in jsFiddle to google and it keeps working after first click. Try it out

于 2013-05-29T23:01:38.657 回答
0

After visiting the link your style stops working. Try implementing this: #nav a:visited {color: white;} Always remember ids are Unique.

于 2013-05-29T23:01:38.933 回答