Here is the CSS code I am using:
.menu_2_1 ul {
float:left;
list-style-type:none;
}
.menu_2_1 ul li {
float:left;
display:inline-block;
width:auto;
height:55px;
margin-left:20px;
padding-top:25px;
}
.menu_2_1 ul li a:link,
.menu_2_1 ul li a:visited,
.menu_2_1 ul li a:hover,
.menu_2_1 ul li a:active {
text-decoration:none;
font-size:1.70em;
color:grey;
padding:25px;
}
.activeLink {
background:lightblue;
color:red;
font-size:1.80em;
}
And here is how I have structured my HTML:
<div class="colm menu_2_1">
<ul>
<li class="activeLink"><a href="#1">Link1</a>
</li>
<li><a href="#2">Link2</a>
</li>
<li><a href="#3">Link3</a>
</li>
</ul>
</div>
<!--colm menu_2_1-->
I wanted to use the "activeLink" class on the links in order to easily add and remove it later with jQuery. However, I noticed that while the class changes other style properties like text decoration and font size, it doesn't change the font color.
Why do you think that is happening? Could it be related to CSS specificity?
Thank you for your help!