<a href="#">
<h1>Our Plus Plan</h1>
<h2>The most popular choice of our customers</h2>
<p>
Benefit from increased storage and faster support to ensure that
your mission-critical data and applications are always available!
</p>
</a>我们知道,内联元素不能包含块元素。但这里工作很好。怎么可能在这里?
发布于 2022-02-01 05:34:52
因为我认为html是不敏感的,如果有一个换行符,那么无论你在标签里面放什么,都会变成一个链接。
发布于 2022-02-01 06:27:29
<a>元素is defined as 的内容模型,这意味着它可以是“流内容”,也可以是“短语内容”,这取决于它的父或祖先。这些内容模型取代了传统的内联元素和块元素之间的分离。
无论如何,浏览器不会破坏页面,甚至在</span>中放置一些无效的东西,比如</span>。
https://stackoverflow.com/questions/70935959
复制相似问题