<输入类型=按钮>与< button> [英] <input type=button> vs <button>

查看:78
本文介绍了<输入类型=按钮>与< button>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点困惑。这些之间有什么区别。请不要引用真正的旧帖子。我注意到访问某些样式在html和样式表中是内联的。

I'm a little confused. What is the difference between these. Please don't reference really old postings. I notice that accessing some of the styles are different inline in html as well as in style sheets.

<input type=button> 
   vs 
<button>

我想我想知道哪个会住哪个?
还是考虑到网站创建所使用的所有通用技术之间的兼容性的简易性最好?又名

I guess I'm wondering which one will out live which? or which is the best when taking into account ease of compatibility between all the general technologies that go into website creation? aka. which is going to cause the least amount of trouble

推荐答案

< input> 标签,< button> 可以包含其他html元素作为其标签。 <输入类型=按钮> 只能接受字符串作为其标签文本(不支持CSS样式)。

Unlike <input> tags, <button>'s can contain other html elements as their labels. <input type="button"> can only accept a string as its label text (css styles not withstanding).

此外,< button> 元素接受有关多种形式和单击操作的各种罕见但有用的属性。 有关详细信息,请参见MDN页面

Additionally, the <button> element accepts a wide range of uncommon but useful attributes regarding multiple forms and click actions. See the MDN page for more details.

对于另一个活着的另一个,HTML标准是向后兼容的。人类会将人类带入火星,然后再将其从HTML标准中删除。

As for one "out living" the other, the HTML standard is remarkably backwards compatible. Humanity will put men on Mars before either is eliminated from the HTML standard.

这篇关于&lt;输入类型=按钮&gt;与&lt; button&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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