在HTML5中,我知道< nav>可以在网页的标头< header>元件。对于同时具有辅助导航和主导航的网站,将辅助导航包括为< nav>元素在< header>元素与主导航作为< nav>标头< header>元件。但是,如果网站缺少辅助导航,则通常将主导航包含在< nav>在< header>中的元素元件。
如果我遵循这些示例,我的内容结构将基于包括或排除辅助导航。这引入了内容和感觉不必要和不自然的风格之间的耦合。
有没有更好的方法,我不会将主导航从内部移动到标头< header>元素基于包含或排除辅助导航?
主和辅助导航示例
Website Title
主要导航示例
Website Title
摘自HTML5简介 – 于02-Feb-11,7:38添加
Introducing HTML5作者:Bruce Lawson和Remy Sharp有这个话题:
The header can also contain navigation. This can be very useful for site-wide navigation,especially on template-driven sites where the whole of the element could come from a template file.
Of course,it’s not required that the be in the .
If depends largely on whether you believe the site-wide navigation belongs in the site-wide header and also pragmatic considerations about ease of styling.
基于最后一句话,看起来布鲁斯·劳森(Bruce Lawson) – 那些摘录的章节作者不承认“关于简约风格的实用考虑”产生了内容和风格之间的联系。