- From: Ian Hickson <py8ieh@bath.ac.uk>
- Date: Tue, 9 Mar 1999 18:03:10 +0000 (BST)
- To: "L. David Baron" <dbaron@fas.harvard.edu>
- cc: www-style@w3.org
On Tue, 9 Mar 1999, L. David Baron wrote: > Let me try and expand this notion a bit, and see what you all think > of the specifics. It all seems perfect, except for one thing. You say: > If user stylesheets specify any color/background pair with important > weight for an element, then they should specify the same color for > all descendants (using the universal selector and possibly other > selectors) of the element and transparent (not inherit) for all > descendants of the element. Transparent should be used so that > positioning does not lead to covering of text. For example: > > P { > color: black ! important; > background: white none ! important; > } > > P * { > color: black ! important; > background: transparent none ! important; > } > > P A:link { color: blue ! important; } > P A:visited { color: purple ! important; } > P A:active { color: red ! important; } What if one of the P children is positioned out-of-flow so that it is over a different element than its normal parent? The transparency could then clash with the new background-color, causing a nice clash and illegible text. eg, HTML document: <P class=a> <EM>text</EM> </P> <DIV class=b> more text </DIV> author css: * { margin: 0; padding: 0; border: none; font-size: inherit; line-height: inherit; } .a { background: maroon; color: white; } .b { background: green; color: white; } EM { position: relative; bottom: -1em; } user.css: P { color: green ! important; background: white none ! important; } P * { color: inherit ! important; background: transparent none ! important; } Effect: The contents of the EM will overlap the DIV, and will be green on green. Oops. So - how can we guard against this? -- Ian Hickson U+2642 U+2651 U+262E U+2603 U+263A
Received on Tuesday, 9 March 1999 13:03:30 UTC