0

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

9
  • 1. You have ##1C1C1C - fix the double hash. 2. Could you add the relevant HTML? Commented Mar 20, 2011 at 4:56
  • I can but the tag make my code disappear Commented Mar 20, 2011 at 4:57
  • You need to indent each line with four spaces. You can do this by selecting the HTML and clicking the {} button. Or, if you simply can't get it to work, just paste it in anyway and I'll fix it. Commented Mar 20, 2011 at 4:58
  • @thirtydot: ok everything is fine.. i got your #1 mistake. (a novice mistake :P) Thanks there Commented Mar 20, 2011 at 4:59
  • You mean fixing that double hash fixed your entire problem? Wow, I really need to start posting these guess-comments as answers.. Commented Mar 20, 2011 at 5:04

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

2 Comments

I assume the id is actually titre. The questioner must be using French, see titre and effet_fondu.
Ya, i see, but he said that first one he put id is "title". I guess he like to change to match at HTML and CSS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.