I've got a test page at:
http://www.sam-i-am.com/work/sandbox/components/nested_containers.html

It shows some tests I'm doing with nesting containers. I'm trying to
define some container styles that will work nested one in the other
(to a reasonable, arbitrary depth e.g. 4 or 5).
I seeing some strangeness in both FF/IE, that defies my understanding
of specificity. On the test page, in the first panel, I'd expect the
nested "type1" to be cyan, not inherit the blue.

The markup for each container type will be uniform, I've used a P here
to indicate the problem - when containers are nested, there's some
abiguity:

.panel1 .container-type1 p {
  background-color: cyan;
}
.panel1 .container-type2 p {
  background-color: blue;
}

when a .container-type1 is nested in a container-type2, both rules
could apply. My understanding was that proximity would win out, so a P
in a container-type1, nested in a container-type2 would pick up its
background-color from its nearest container - container-type1. But not
so...

Weirder still, when I increase specificity, seen in the 2nd panel like so:
.panel2 .container-type2 .container-type1 p {
  background-color: pink; /* this isnt working. */
}
.panel2 .container-type1 .container-type2 p {
  background-color: purple;
}

that doesnt work in both cases. I dont want to do this if possible
anyway (then I have to add all possible permutations), but it /should/
work, shouldn't it?

thanks, Sam
______________________________________________________________________
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/

Reply via email to