放置< div>是否在语义上不正确?或者< span>在<按钮>内部吗? [英] Is it semantically incorrect to put a <div> or <span> inside of a <button>?
本文介绍了放置< div>是否在语义上不正确?或者< span>在<按钮>内部吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想执行以下操作,但它在语义上是否正确?
< button>
< div>< / div>
< div>< / div>
< / button>
解决方案
目前的HTML5草案显示它不正确。 p>
http://www.w3.org/TR/2012/WD-html5-20120329/the-button-element.html#the-button-element 表示<按钮>
必须只包含短语内容。短信内容定义为包括< span>
但不是< div>
。
I'd like to do the following, but is it semantically correct?
<button>
<div></div>
<div></div>
</button>
解决方案
The current HTML5 draft says it is incorrect.
http://www.w3.org/TR/2012/WD-html5-20120329/the-button-element.html#the-button-element says that a <button>
must contain only Phrasing content. Phrasing content is defined as including <span>
but not <div>
.
这篇关于放置< div>是否在语义上不正确?或者< span>在<按钮>内部吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文