On Mon, Nov 14, 2011 at 8:46 PM, Paceaux <[email protected]> wrote:
> thank you, Philippe. That answers my question.
>
> I was "hoping" that the combinator could go upward in the document tree, but
> my experiments with that weren't working. It was an off-the-wall bet that
> I could change styles based on whether another element were present in a
> neighboring document tree. Ultimately,this confirms that the sibling
> combinator doesn't work as an "aunt" or "uncle" combinator.
Given your original code snippet:
<div id="ftwrap />
<div class="address"/>
<div class="newsletter" />
<p />
<form />
<p />
<ul id="nav_social">
It appears that .address and .newsletter are indeed siblings. So, could you:
.address {margin: 0; /* or whatever you need*/}
.address + .newsletter {margin-top: 14px;}
Instead of trying to add to the bottom of .address, just add to the
top of .newsletter if it follows .address.
Of course, if other elements are possible between them you'd need the
indirect selector. Assuming, of course, I've understood you question
correctly.
Tim
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/