gpt4 book ai didi

html - 哪个页面布局更正确?

转载 作者:搜寻专家 更新时间:2023-10-31 08:04:02 26 4
gpt4 key购买 nike

加上 <main> HTML5 规范草案中的元素,哪个是更正确的页面布局?

<body>
<header> ... </header>
<main>
<aside> ... </aside>
</main>
<footer> ... </footer>
</body>

或;

<body>
<header> ... </header>
<section>
<main> ... </main>
<aside> ... </aside>
</section>
<footer> ... </footer>
</body>

最佳答案

关于每个示例标记模式的正确性的答案可以在 normative definition 中找到。的主要元素。

Contexts in which this element can be used: Where flow content is expected, but with no article, aside, footer, header or nav element ancestors. Authors must not include more than one main element in a document.

在这种情况下,任一示例标记都是符合要求的。仅从理论示例很难知道哪个最合适或最实用。

And which spec are the browsers following?

浏览器已经实现了 W3C HTML specification 中定义的主要元素.一致性检查器,例如 W3C HTML validator将实现 W3C HTML 规范的一致性要求。

注意:主要元素将为added to HTML 5.0在不久的将来。

注意:HTML 5.1 中主要元素的规范取代了扩展规范。

关于html - 哪个页面布局更正确?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14769559/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com