Hi All,
I have a question about the priority of CSS classes after encountering a problem today. The situation is as follows:
I have an unordered list which has a class associated with it. The LI tags has some styles defined too. I want to change the styling of the LIs after a click (a "selected" class) but the added class's styles are never applied. Is this normal behaviour or should this code work?
.dynamicList
{
list-style: none;
}
.dynamicList li
{
display: block;
width: 400px;
height: 55px;
padding: 10px 10px 10px 10px;
border: 1px solid #000;
background-color: #ff0000;
}
.selectedItem
{
background-color: #0000ff;
}
//html
<ul class="dynamicList">
<li>First Item</li>
<li class="selectedItem">Second (Selected) Item</li>
<ul>
Basically the background colour of the "Selected" list item isnt changed. This is also the case if i dont apply the style to the LI element but create another class and apply that to all the list items so it reads..
<li class="listitem selectedItem">xxxx</li>
Cheers Stuart