Closed
Bug 443967
Opened 17 years ago
Closed 17 years ago
Overlapping CSS rules conflict; new rules ignored due to IDs/classes
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: blasterdrp, Unassigned)
References
()
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Properties of a class/ID declared earlier in a parent class/ID are ignored.
Reproducible: Always
Steps to Reproduce:
1. Create element #parent whose p children are text-align: left.
2. Create sibling paragraph with class .child with text-align: center.
Actual Results:
All children, including .child, will have text-align: left.
Expected Results:
All children except .child should have text-align: left, who should have text-align: center.
Example included in HTML file.
Comment 1•17 years ago
|
||
Per http://www.w3.org/TR/CSS21/cascade.html#specificity
The specificity of "#test p" is 0101
The specificity of ".center" is 0010
http://www.w3.org/TR/CSS21/cascade.html#cascading-order
Bullet 3: "Sort rules with the same importance and origin by specificity of selector: more specific selectors will override more general ones."
Your rules have the same importance and origin, so the one with the
higher specificity wins.
-> INVALID
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
So basically, it comes down to a calculation rather than logic? How contrived. Sounds like the specification is inadequate.
You need to log in
before you can comment on or make changes to this bug.
Description
•