Le 15 mars 2013 à 07:38, Markus Ernst <[email protected]> a écrit :

> I wonder how people use the adjacent selector with HTML5 elements that need 
> to be nested, as legacy browsers do not recognize the new elements, such as:
> 
> <article>
>  <div class="article">
>  ...
>  </div>
> </article>
> <footer>
>  <div class="footer">
>  ...
>  </div>
> </footer>
> 
> The selector "article + footer" will probably not work in legacy browsers, 
> while ".article + .footer" does not match the elements.

If the html5shiv.js is used (or the Modernizr/Foundation/Bootstrap equivalent), 
then the article and footer elements are recognised in old IE (IE < 9). They 
then can be used for styling purposes.

Losers are old Gecko browsers (Firefox 2) and very old Safari (v1 only, I 
think). Not many of those around, me thinks.

To your original question, given the structure of your documents as provided, 
nope, you can't select your <nav> based on the (non-)existing section(s). 
Perhaps use JS to add a class to the <nav> if and only if the sections don't 
exist (or only if they exist). The use that class to add or remove that border. 
Should be quite easy with Jquery, I think.

Philippe
--
Philippe Wittenbergh
http://l-c-n.com




______________________________________________________________________
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/

Reply via email to