gpt4 book ai didi

html - 图例中的 header 有效吗? <图例>

标题

转载 作者:太空狗 更新时间:2023-10-29 13:33:51 27 4
gpt4 key购买 nike

我在 visual studio 中使用它,但编译器声称 h1 不能嵌套在 legend 元素中,但浏览器无论如何都可以呈现它,所以我很困惑这是有效的还是不是?

<fieldset>
<legend>
<h1>Caption</h1>
</legend>
</fieldset>

最佳答案

浏览器做的很多事情是标准不需要的:-)

本页here (HTML4) 指定 legend 关键字并声明它可以包含 inline elements ,标题不是其中的一部分。它还有其他可能有用的功能,例如 bigstrong

另外,H1的相关页面没有将 legend 列为允许包含在其中的项目之一。您还可以使用图例的 idclassstyle 属性来设置基础文本属性。

关于html - 图例中的 header 有效吗? <图例><h1>标题</h1></图例>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8005887/

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