|
Posted by City Dweller on 11/27/36 11:56
Hello everyone,
Hope someone can explain this to me....
<style>
h1#jo { color: red }
</style>
<h1 id="jo" style="color: yellow">ABC</h1>
All browsers display ABC in yellow. Why? According to CSS specs, the
specificity of "color: yellow" is 100 since it is a STYLE attribute
inside a tag. However, the specificity of "color: red" is 101, a = 1
for #id, b = 0, and c = 1 for h1.
So I would think ABC should be red not yellow. Where is the flaw in my
calculations?
Thanks.
-- City Dweller
Navigation:
[Reply to this message]
|