Click here to Skip to main content
15,867,885 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the following code I would like to change the border_color to black.
I tried with the following code but border-color not getting changed for class '.About'
to black. How to do it?
XML
<div id="header" class="header">
    <ul id="nav">
      <li id="ddd">
      <h1>
      vasan heights
      </h1>
      </li>
      <li class="home"><a href="#">Home</a></li>
      <li class="About us" ><a href="#">About us</a>


CSS
#nav li a {
    color: white;
    text-decoration: none;
    display: block;
}

#header #nav a .About us
{
  border-color:Blue;
}
Posted

1 solution

change your css as:


CSS
#header #nav .Aboutus
{
  border:1px solid blue;
}
 
Share this answer
 
Comments
S.Rajendran from Coimbatore 7-Dec-14 2:26am    
No, it is not working.
Ishpreet Kaur 7-Dec-14 2:29am    
What you have written?? can you post your css?
Ishpreet Kaur 7-Dec-14 2:32am    
change your html as:

<div id="header" class="header">
<ul id="nav">
<li id="ddd">


vasan heights


</li>
<li class="home">Home</li>
<li class="Aboutus" >About us</li>
</div>
Ishpreet Kaur 7-Dec-14 2:34am    
In your line: <li class="Aboutus">.. </li>, class is: "About us" and change it to class="Aboutus"
S.Rajendran from Coimbatore 7-Dec-14 2:41am    
Well, it works. The mistake was that I have a space between 'About' and 'us' in class
instead of coding as 'Aboutus' as a single word without space. Thanks.

#header #nav .Aboutus
{
border:1px solid blue;

}

Now, how to use margin-left for the same class 'Aboutus'.

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