Can tags have any type of tags inside them?

后端 未结 2 1045
离开以前
离开以前 2020-11-30 04:38

Are tags such as

,
,
 etc.. allowed inside a ?

2条回答
  •  攒了一身酷
    2020-11-30 04:59

    The span element is an inline element, which should contain only other inline elements and no block elements.

    From 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.

    The generic block-level grouping element is the div. The generic inline-level grouping element is the span.

    Again, from 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.

提交回复
热议问题