Forum Moderators: not2easy
Currently I have some code similar to this
<ul>
<li>item1</li>
<li>item2</li>
<li class="red">item3</li>
<li>item4</li>
</ul>
By default, my stylesheet makes all <li> elements blue in color. Its only the special "item3" that needs to be red so I assigned a class to it (i hope that's a feasible way to do so)
However I have a javascript to toggle the display of the entire <ul>, that is to make it hidden and shown. Toggling the display works just fine, but when I made it back to show, all the <li> are blue. The one with the red class seems to have ignored the css...
IF i did this instead: <li style="color:red">item3<li>
Then it works just as intended, but is this suppose to be the way? Because inline css is not quite the standard around things
Am i missing out anything here?
Many thanks
Veliscorin
So, use class names that describe the content, not the presentation. :-)