I've noticed that whenever I have a selector that starts with #id_name, it has the highest precedence, even if I put something lower in the CSS file that should override it. This occurs in all 3 browsers I use (IE, FF, Opera), so I'm thinking it's intentional in the standard somewhere.
Here is an example:
Code:
#main .corner{
height: 10px;
}
.display .corner{
height: 7px;
}
----
<div id="main">
<!-- other markup here -->
<div class="display">
<div class="corner"></div>
<!-- other markup here -->
</div>
</div>
The <div class="corner"> will have a height of 10px instead of 7px. I know I can use !important, but I'm just curious why this occurs in my example. Does anyone have any ideas?
__________________
The interlocking pieces of web development: usability, performance, accessibility, and standards.
Last edited by frost; 10-04-2007 at 08:13 PM..
Reason: OOPS, typo
|