<按钮和GT;与<输入类型=”按钮" /取代。它使用? [英] <button> vs. <input type="button" />. Which to use?

查看:179
本文介绍了<按钮和GT;与<输入类型=”按钮" /取代。它使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在看大多数网站(包括SO),他们大多是:

When looking at most sites (including SO), most of them use:

<input type="button" />

而不是:

<button></button>


  • 什么是两者之间的主要区别,如果有的话?

  • 有没有使用有效的原因之一,而不是其他?

  • 是否有使用结合他们的正当理由?

  • 使用是否&LT;按钮和GT; 配有兼容问题,看它是不是很广泛的应用

    • What are the main differences between the two, if any?
    • Are there valid reasons to use one instead of the other?
    • Are there valid reasons to use combine them?
    • Does using <button> come with compatibility issues, seeing it is not very widely used?
    • 推荐答案


      • Here's一个页面描述差异(基本上你可以把HTML成&LT;按钮和GT;&LT; /按钮&GT;

      • 和另一页面描述为什么人们避免&LT;按钮和GT ;&LT; /按钮&GT; (提示:IE6)

      • Here's a page describing the differences (basically you can put html into a <button></button>)
      • And an other page describing why people avoid <button></button> (Hint: IE6)
      • 另一个IE的问题&LT;按钮/&GT;

        虽然我们谈论的IE浏览器,它的
          有一对夫妇的bug有关
          按钮的宽度。它会神不知鬼不觉
          加上微胖,当你试图
          添加的样式,这意味着你必须添加
          一个微小的黑客要得到的东西
          控制。

        And while we're talking about IE, it's got a couple of bugs related to the width of buttons. It'll mysteriously add extra padding when you're trying to add styles, meaning you have to add a tiny hack to get things under control.

        这篇关于&LT;按钮和GT;与&LT;输入类型=&rdquo;按钮&QUOT; /取代。它使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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