CSS problem with a html menu
i made a vertical menu. I want that the first tab has a different color than the other ones. I put the color black for the other one. Here's my code
in my html code i got the ul (class = "vertical") and in a "li" there's a link <a>
.. the first one i put a id = "title"
CSS
.vertical{
list-style-type: none;
margin: 0;
padding: 0;
width: 100%;
}
#titre{
background: ##1C1C1C url(image/menu_PC/effet_fondu.gif) no-repeat right top;
}
.vertical li{
border-bottom: 1px solid white; /* white border beneath each menu item */
}
.vertical li a{
background: #6E6E6E url(image/menu_PC/effet_fondu.gif) no-repeat right top;
font: bold 13px "Lucida Grande", "Trebuchet MS", Verdana;
display: block;
color: white;
width: auto;
padding: 5px 0; /* Vertical (top/bottom)开发者_如何学运维 padding for each menu link */
text-indent: 8px;
text-decoration: none;
border-bottom: 1px solid black;
}
.vertical li a:visited, .vertical li a:active{
color: white;
}
.vertical li a:hover{
background-color: black; /*color of menu onMouseover*/
color: white;
border-bottom: 1px solid black;
}
Thank you
Well, as I said in the comments:
You have
##1C1C1C
- fix the double hash.
Inside here:
#titre{
background: ##1C1C1C url(image/menu_PC/effet_fondu.gif) no-repeat right top;
}
The entire background
rule was being ignored due to the invalid colour format.
Make sure you have id called "titre" in HTML, because you have called "titre" ID in CSS, and make sure you have following code too in css.
#titre
{ background: #1C1C1C url(image/menu_PC/effet_fondu.gif) no-repeat right top;}
I presume, you want to change name as "title", so you need to change in CSS code instead of titre.
精彩评论