Göra om CSS för en menu (div->ul)
Jag vill göra om en meny gjord med divs till en lista. Först lite kod, vi börjar med html:
<div id="sidebar">
<div class="box sidebarMenu top"> <a href="#"> Meny1 </a></div>
<div class="box sidebarMenu middle"> <a href="#">Meny2 </a> </div>
<div class="box sidebarMenu bottom"> <a href="#">Meny3</a> </div>
</div>
och nu CSS:
.box {
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-color:#D1D1D1;
border-style:solid;
border-width:1px 1px;
background-color: #F4F4F4;
margin-bottom: 18px;
font-size: 11px;
line-height: 15px;
}
.box.sidebarMenu {
background-image: url(../images/sprites/gradients.png);
background-position: bottom;
background-color: #fff;
font-size: 12px;
padding: 7px 12px;
margin-bottom: 0px;
}
.box.sidebarMenu.top {
-moz-border-radius-bottomleft:0px;
-moz-border-radius-bottomright:0px;
-webkit-border-radius-bottomleft:0px;
-webkit-border-radius-bottomright:0px;
border-bottom: 0px;
}
.box.sidebarMenu.middle {
-moz-border-radius-bottomleft:0px;
-moz-border-radius-bottomright:0px;
-moz-border-radius-topleft:0px;
-moz-border-radius-topright:0px;
-webkit-border-radius-bottomleft:0px;
-webkit-border-radius-bottomright:0px;
-webkit-border-radius-topleft:0px;
-webkit-border-radius-topright:0px;
border-bottom: 0px;
}
.box.sidebarMenu.bottom {
-moz-border-radius-topleft:0px;
-moz-border-radius-topright:0px;
-webkit-border-radius-topleft:0px;
-webkit-border-radius-topright:0px;
margin-bottom: 18px;
}
Den nya html kommer se ut (notera class):
<div id="sidebar">
<ul class="sidebarMenu">
<li class="leaf first"><a href="#">Meny1</a></li>
<li class="leaf"><a href="#">Meny2</a></li>
<li class="leaf last"><a href="#">Meny3</a></li>
</ul>
</div>
Hur skulle ni lösa detta smidigast? Jag har klurat lite men är intresserad av andras lösningar.