On 10/6/06, Dave Pierce <[EMAIL PROTECTED]> wrote:
> > ..panel1 .container-type1 p {
> > background-color: cyan;
> > }
> > ..panel1 .container-type2 p {
> > background-color: blue;
> > }
> > ..panel2 .container-type2 .container-type1 p {
> > background-color: pink; /* this isnt working. */
> > }
> > ..panel2 .container-type1 .container-type2 p {
> > background-color: purple;
> > }
>
> Sam,
>
> It looks to me like your second statement is overriding the first.
>
> In the first statement, you've designated panel 2, both types of
> containers, to have pink backgrounds.
No. A sequence of specifiers in CSS specifies a descendant
relationship, not an "either or" relationship. The specifier "
.panel2 .container-type2 .container-type1 p " says "any paragraph
contained in an element whose classes include "container-type1" which
is in turn contained in an element whose classes include
"container-type2" which is in turn contained in an element whose
classes include "panel2". The containment need not be direct but may
have any arbitrary number of interceding elements, so the paragraph
below would match:
<html class="panel2">
<head><title>My Nifty Page</title></head>
<body class="container-type2">
<h1>My Nifty Page</h1>
<div id="nav">
<div class="container-type1">
<div id="whooee">
<p>I match that specifier!</p>
</div>
</div>
</div>
</body>
</html>
element whose class is "panel2"
> In the second statement, you've designated panel two, both
> containers, to have a purple background.
>
> Also, remember that the p will be recognized by CSS as controlling
> your <p> paragraphs. I think that means that the paragaph color is
> overriding any desired color callouts.
> Instead of marking the problem items with a letter, you should
> probably use a /*comment*/
>
> Not sure if that means anything, or if I'm right...I'm no expert,
> just a beginner.
>
> Dave Pierce
> Pierce Art & Design
>
> ______________________________________________________________________
> css-discuss [EMAIL PROTECTED]
> http://www.css-discuss.org/mailman/listinfo/css-d
> IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
> List wiki/FAQ -- http://css-discuss.incutio.com/
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
>
--
Mark J. Reed <[EMAIL PROTECTED]>
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/