Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以在表格内的元素中填充<a>和<h2>元素吗?<caption>在浏览器中看起来不错,但可以这样做吗?
<a>
<h2>
<caption>
当然。任何流内容——即你可以直接拥有的相同元素<body>——除了<table>在<caption>元素中都可以。
<body>
<table>
根据规范,caption元素只能包含内联元素。所以<a>可以,<h2>不是。应该没有理由在此处使用h2标记,因为caption元素本身是类似标题的;使用 CSS,您可以根据需要在视觉上将其样式设置为更像标题。
caption
h2