I have This Menu For Horizontal Menu. How To generate css for selected li
or a.li
.
HTML :
<ul class="arrowunderline">
<li><a href="#">Home</a></li>
<li><a href="#">New</a></li>
<li class="selected"><a href="#">Revised</a></li> <!-- IF a.LI selected <a class="selected" > END -->
<li><a href="#">Tools</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">Forums</a></li>
</ul>
CSS:
ul.arrowunderline{
list-style-type:none;
margin:0;
padding:0;
text-align:center; /* enter "left", "right", or "center" to orient the menu accordingly */
font: bold 16px Georgia;
margin-top: 60px;
}
ul.arrowunderline li{
display:inline;
margin-right:25px; /* spacing between each menu item */
}
ul.arrowunderline li a{
position:relative;
color:black;
padding-bottom:8px; /*spacing between each menu item and arrow underline beneath it */
text-decoration:none;
}
ul.arrowunderline li a:hover:after{ /* use CSS generated content to add arrow to the menu */
content:'';
position:absolute;
left:50%;
margin-left:-75px;
margin-top: -60px;
width:150px;
height:40px;
background:url(http://i.stack.imgur.com/7jpU4.png) center bottom no-repeat;
}
UPDATE : Online Demo: http://jsfiddle.net/uc6Yz/2/
ul.arrowunderline li.selected
? It is unclear what you need help with. – MMMul.arrowunderline li.selected
this is very basic@ my question. i know . how to generate is :ul.arrowunderline li.selected
{//THIS IS GENERATE CSS
} – Saimon Avazianposition:absolute;
andcontent ''
... i dont any idea forul.arrowunderline li.selected { //place your code here (to modify list item) }
. in fact, What is produced is actually a bit complicated. i need to selected this menu. You Done ? UPDATE DEMO : jsfiddle.net/uc6Yz/2 – Saimon Avazian