arboles arboles - 1 year ago 88
CSS Question

css class not applying styling, but id is applying styling?

I have my HTML set up as follows

<a class="nodecoration"></a>


.nodecoration {

When I change my anchor tag to
<a id="nodecoration"></a>
and change the CSS to:

#nodecoration {

The element now styles. Why is this?

Side note: I am also using Twitter Bootstrap, is the CSS from that interfering?

Answer Source

This is an indication that another style rule has precedence over that rule. You may want to make that rule more specific by using a.nodecoration which should increase its precedence.

FYI, tools like firebug for Firefox will tell you which rule(s) have the higher precedence.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download