Click here to Skip to main content
14,692,015 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
css :

<style type="text/css">

.backround
{
margin: 0px 0;
padding: 0;
position: absolute;
background-image: url( 'Images/imageback.jpg' );
font-family: Times New Roman;
font-size: small;
width: auto;
height: auto;
font-size: 19px;
font-weight: bold;
text-decoration: none;
}
.div
{
width: auto;
margin: 0px auto;
}
div ul li a:link, div ul li a:visited
{
display: block;
background-color: #006699;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 14px;
color: #c1bfd5;
text-align: center;
text-decoration: none;
padding: 2px;
border-bottom: 1px solid #fff;
width: 150px;
line-height: 30px;
}




div ul li a:hover
{
background-color: #030;

}
div ul li a:active,div ul li a.active
{
background-color:Red;
}






li ul li a:link, li ul li a:visited
{
display: block;
background-color: #99ccff;
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
font-size: 12px;
color: Blue;
text-align: center;
text-decoration: none;
padding: 2px;
border-bottom: 1px solid #fff;
width: 150px;
line-height: 30px;
}


li ul li a:hover
{
background-color: #CCFFFF;
}
li ul li a:active,li ul li a.active
{
background-color:Red;
}

ul
{
list-style-type: none;
margin: 0px;
padding: 0px;
width: 1092px;
}
div ul li
{
float: left;
width: 150px;
}

ul li ul li
{
float: none;
margin-left: 0px;
}



li ul
{
display: none;
position: absolute;
}
li:hover ul
{
display:none;
}
.style1
{
height: 25px;
}
.highlight_stay
{
background-color: Red;
}



</style>




Posted
Comments
Er. Tushar Srivastava 22-Dec-13 8:36am
   
Sorry, but I didn't understand the question completely. do you want to somehow highlight any link when it is clicked or you want to highlight the current page in the navigation bar? If it is the first case, the method is a.mylink:active { background: yellow; } where any link having class mylink will get background color yellow when clicked :) If the case is latter, then there is another method using javascript simply. Just let me know. I will respond :)

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900