gpt4 book ai didi

html - 哪个先出现,主要标签还是部分标签?

转载 作者:行者123 更新时间:2023-12-04 16:03:49 24 4
gpt4 key购买 nike

<section>标签位于 <main> 内标记或相反?可以做<main>标签包含许多 <section>标签作为它的后代?例子:

<body>
<main>
<section></section>
<section></section>
<section></section>
<section></section>
</main>
</body>

最佳答案

我不同意 divya jyothi。在该示例中,“部分”用于构建页面的各个块,而它应该用于将文章中的内容划分为有意义的块。
显然,这取决于个人喜好,但这是我向客户推荐的:

<html>
<head></head>

<body>
<header>
<nav>[main menu]</nav>
</header>

<main>
<article>

<h1></h1>
<p>Intro</p>

<section>
<h2>Header for theme of first section</h2>
<p>Text</p>
</section>
<section>
<h2>Header for theme of second section</h2>
<p>Text</p>
</section>
<section>
<h2>Header for theme of third section</h2>
<p>Text</p>
</section>

<aside>
Comments directly related to the article
</aside>
<aside>
Other articles similar to the main article
</aside>

</article>

<aside>
Block of content not directly related to article ie form to sign up
</aside>



</main>
<nav>[right column menu]</nav>

<footer>
<nav>[bottom menu]</nav>
</footer>
</body>
</html>

变化显然是无限的,但我认为这是一个很好的基本模板。在这里阅读更多 https://www.semrush.com/blog/semantic-html5-guide/您可以在此处可视化您的语义 HTML5 结构 https://sitegardien.com/html5viewer/semantichtml5viewer.php

关于html - 哪个先出现,主要标签还是部分标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53312628/

24 4 0