我有一个菜单,其中每个链接都是一个div框。这个 div 框有一个灰色的底部边框,但是,当访问链接时,它会变成黑色。我只是想不通为什么。
在下图中,我单击了Rediger 配置文件和Log af链接。
JSFiddle:http: //jsfiddle.net/LpGbT/
HTML
<div id="design_sidebar">
<div id="design_sidebar_head">
Patrick Reck
</div>
<a href="#"><div class="design_sidebar_menu_item">Besøgende</div></a>
<a href="#"><div class="design_sidebar_menu_item">Mine favoritter</div></a>
<a href="<?php echo site_url('profile/editProfile');?>"><div class="design_sidebar_menu_item">Rediger profil</div></a>
<a href="<?php echo site_url('user/logout');?>"><div class="design_sidebar_menu_item">Log af</div></a>
</div>
CSS
a {
text-decoration: none;
}
#design_sidebar {
width: 200px;
float: left;
border: 1px solid #d6d6d6;
-moz-border-radius: 2px;
border-radius: 2px;
background-color: white;
}
#design_sidebar_head {
width: 165px;
height: 30px;
font-family: Segoe;
font-size: 14px;
font-weight: bold;
color: #333333;
padding-top: 10px;
padding-left: 35px;
border-bottom: 1px solid #d6d6d6;
background-image: url('../img/icons/user.png');
background-repeat: no-repeat;
background-position: 10px 11px;
background-color: #f7f7f7;
}
.design_sidebar_menu_item {
padding: 5px;
padding-left: 10px;
font-size: 14px;
color: #333333;
border-bottom: 1px solid #d6d6d6;
}
.design_sidebar_menu_item:hover {
color: white;
background-color: #a6242f;
}