...

View Full Version : help html/css



iceman123123
01-06-2013, 09:10 PM
i try make a blue color in the <li>Home</li>
html
<ul>
<li><a href="#" class="blue1">Home</a></li>
<li><a href="#">Service /</a></li>
<li><a href="#">Protfolio /</a></li>
<li><a href="#">Blog /</a></li>
<li><a href="#">Contact /</a></li>
</ul>


css

#header ul{
float: left;
}

#header ul li{
float: left;
text-decoration: none;

}


#header ul li a {
font-family: arial;
font-size: 20px;
color:#444444 ;
text-decoration: none;

}


.blue1 {
color:0b79a3;


}

#header ul blue1{
color: 0b79a3 ;

}

tempz
01-06-2013, 09:19 PM
i try make a blue color in the <li>Home</li>
html
<ul>
<li><a href="#" class="blue1">Home</a></li>
<li><a href="#">Service /</a></li>
<li><a href="#">Protfolio /</a></li>
<li><a href="#">Blog /</a></li>
<li><a href="#">Contact /</a></li>
</ul>

.....continues!..



New code.


<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Service /</a></li>
<li><a href="#">Protfolio /</a></li>
<li><a href="#">Blog /</a></li>
<li><a href="#">Contact /</a></li>
</ul>


css

#header ul li a:first-child {color:#0b79a3;} /* Target is "a" tag */
#header ul li:first-child {color:#0b79a3;} /* Target is "li" tag */

AndrewGSW
01-06-2013, 09:28 PM
color: #0b79a3;

iceman123123
01-06-2013, 10:09 PM
i put # in my editor in here i delete this By mistake.

still dont working.

iceman123123
01-06-2013, 10:50 PM
#header ul .blue1 {color:#0b79a3;} works................

AndrewGSW
01-06-2013, 11:13 PM
Yes, you needed a dot for the class.


#header ul li a {
font-family: arial;
font-size: 20px;
color:#444444 ;
text-decoration: none;

}


.blue1 {
color:#0b79a3;

}
This combination doesn't work because both refer to the same elements (assuming your list is contained within #header), and the first section has higher specificity - it is a more specific selector than the second one.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum