可以< span>标签里面有任何类型的标签? [英] Can <span> tags have any type of tags inside them?

查看:164
本文介绍了可以< span>标签里面有任何类型的标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< div> < form> < ; pre> etc ..允许在< span>

span 元素是一个 inline 元素,它应该只包含其他的 inline 元素和元素。



From 规范
$ b


通常,块级元素可能
包含内联元素和其他
块级元素。通常,
内联元素可能只包含数据
和其他内联元素。
固有的结构区别是
的概念,块元素创建
更大的结构,而不是内联
元素。

通用块级分组元素是 div 。泛型内联级分组元素是 span



同样,从规范



中的DIV和SPAN元素与ID和类
属性一起提供了一种通用机制
,用于将结构添加到文档。
这些元素将内容定义为
内联(SPAN)或块级别(DIV),但
不会对内容施加其他表示形式



Are tags such as <div>, <form>, <pre> etc.. allowed inside a <span>?

解决方案

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.

这篇关于可以&lt; span&gt;标签里面有任何类型的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆