我应该在我的新站点上使用HTML5特定的标签来搜索,这样我就可以保持语义正确吗?我的网站的结构是这样的
--------------------
Header
--------------------
search | nav
--------------------
article
--------------------
footer
--------------------这是我最关心的问题,因为搜索在这个页面上扮演着重要的角色。
发布于 2012-03-20 17:00:49
您可以使用:
<input type="search">搜索是导航网站的一种方式,因此只需将其添加到<nav>元素即可。
在本例中,<nav>元素可以是<header> just like the last example in the spec的子元素。
<header>
<h1>Site title</h1>
<input type="search" placeholder="Search…">
<nav>
…
</nav>
</header>
<article>
<h1>Page title</h1>
</article>
<footer>
…
</footer>发布于 2014-11-19 18:27:31
你的结构应该是这样的(如果你遵循html5):
<header>this is header</header>
<section>
<section>
<form>
<input type="search">
</form>
</section>
<nav>
this is navigation
</nav>
</section>
<main>
<article>this content article</article>
<aside>this sidebar</aside>
</main>
<footer>this is footer</footer>https://stackoverflow.com/questions/9783804
复制相似问题