gpt4 book ai didi

html - 标签中可以包含任何类型的标签吗?

转载 作者:技术小花猫 更新时间:2023-10-29 11:40:19 27 4
gpt4 key购买 nike

<div>之类的标签, <form> , <pre>等..允许在<span>内?

最佳答案

span 元素是一个内联 元素,它应该只包含其他内联 元素,不包含 block 元素.

来自 the spec :

Generally, block-level elements may contain inline elements and other block-level elements. Generally, inline elements may contain only data and other inline elements. Inherent in this structural distinction is the idea that block elements create "larger" structures than inline elements.

通用 block 级分组元素是 div。通用内联级分组元素是 span

同样,来自 the spec :

The DIV and SPAN elements, in conjunction with the id and class attributes, offer a generic mechanism for adding structure to documents. These elements define content to be inline (SPAN) or block-level (DIV) but impose no other presentational idioms on the content.

关于html - <span> 标签中可以包含任何类型的标签吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5545884/

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