This specific pseudo-class is designed to target any element that is currently in the process of being activated. For example, it would be active during a mouse-click on a link, starting from when the mouse button is pressed down until it is released. It's important to note that this pseudo-class does not indicate a link to the active page—it's a common misunderstanding among those new to CSS.
Click here for more information
li class="current"
.HeaderTabs li.tab a.current {
color: #A4C639;
font-weight: bold;
}
In CSS, comments are denoted with /* Comment */
, not //
which is used in JavaScript.
EXAMPLE
HTML/MARKUP
File = index.html
<ul>
<li class="current"><a href="index.html"</a>Home</li>
<li><a href="about_us.html"</a>About Us</li>
<li><a href="news.html"</a>News</li>
<li><a href="products.html"</a>Products</li>
<li><a href="contact_us.html"</a>Contact Us</li>
</ul>
File = abouts_us.html
<ul>
<li><a href="index.html"</a>Home</li>
<li class="current"><a href="about_us.html"</a>About Us</li>
<li><a href="news.html"</a>News</li>
<li><a href="products.html"</a>Products</li>
<li><a href="contact_us.html"</a>Contact Us</li>
</ul>
File = news.html
<ul>
<li><a href="index.html"</a>Home</li>
<li><a href="about_us.html"</a>About Us</li>
<li class="current"><a href="news.html"</a>News</li>
<li><a href="products.html"</a>Products</li>
<li><a href="contact_us.html"</a>Contact Us</li>
</ul>
File = products.html
<ul>
<li><a href="index.html"</a>Home</li>
<li><a href="about_us.html"</a>About Us</li>
<li><a href="news.html"</a>News</li>
<li class="current"><a href="products.html"</a>Products</li>
<li><a href="contact_us.html"</a>Contact Us</li>
</ul>
File = contact_us.html
<ul>
<li><a href="index.html"</a>Home</li>
<li><a href="about_us.html"</a>About Us</li>
<li><a href="news.html"</a>News</li>
<li><a href="products.html"</a>Products</li>
<li class="current"><a href="contact_us.html"</a>Contact Us</li>
</ul>
STYLES/CSS
li.current
{
color: #A4C639;
font-weight: bold;
}
You may also need to apply the class="current"
to the <a>
instead of the <li>
and use
a.current
{
color: #A4C639;
font-weight: bold;
}