|
One day my friend shyam designed a web site. He has to make highlight his left menu with his current layout. But he is not familiar with CSS. So he used PHP variable for his site. Putting PHP variables in every page is very large work and it will give many problems.
So I thought that there must be a way with CSS. I have tried. To be frank I searched many sites to get any relevant code.
At last I got it. Here you can have the code.
First Step: write a style sheet.
li{
color:#006600;
}
#home .home, #about .about, #contact .contact.li{
font-weight:bold;
list-style: square outside;
color:green;
text-decoration:none;
}
Now attache it to your document.
Second Step: In your left menu, you have to write like this:
<ul>
<li class="home"><a href="#" class="home">Home</a></li>
<li class="about"><a href="#" class="about">About
us</a></li>
<li class="contact"><a href="#" class="contact">Contact
us</a></li>
</ul>
3rd step: You have to write an Id in your document body tag:
If your page is home, it should be <body id="home">
Recently I have modified this for my company site.
I will come up with my modificated code later.
|