div和span是否允许在表单元素中? [英] Are divs and spans allowed inside form elements?
问题描述
我在问这个问题来测试我的HTML的有效性。我可以很好地尝试这个(我有,而且有可能),但我只是好奇,这是否允许在HTML中。如果不是,如何模拟表单内的div或span元素?使用blockquote?
form 元素在HTML中。通常,块级元素允许块级和嵌入子级。 div
和 span
都是 form
的有效子元素。
有大量资源可以在线了解更多关于此主题的信息,例如: http://www.w3.org/TR/html4/struct/global.html#h-7.5.3 =noreferrer> http://www.w3.org/TR/html4/struct/global .html#h-7.5.3
阅读盒模型可能对您有所帮助,因为这是网络最基本的概念之一设计/开发。
http: //www.w3.org/TR/CSS2/box.html
I am asking this question to test the validity of my HTML. I can very well try this out (and I have, and it's possible), but I'm simply curious whether or not this is allowed in HTML. If not, how can one simulate a div or span element inside a form? Using blockquote?
form
is a block-level element in HTML. Typically, block-level elements allow both block-level and inline children. Both div
and span
are valid children of form
.
There are a ton of resources online to learn more about this topic, for example:
http://www.w3.org/TR/html4/struct/global.html#h-7.5.3
It may also benefit you to read about the box model, as this is one of the most fundamental concepts of web design/development.
http://www.w3.org/TR/CSS2/box.html
这篇关于div和span是否允许在表单元素中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!