Memor.の 2009-01-22 13:14 采纳率: 100%
浏览 503
已采纳

按钮与输入类型"按钮"/ 。 使用哪一个?

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

<input type="button" />

instead of:

<button></button>
  • 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?

转载于:https://stackoverflow.com/questions/469059/button-vs-input-type-button-which-to-use

  • 写回答

15条回答 默认 最新

  • Memor.の 2009-01-22 13:20
    关注
    • Here's a page describing the differences (basically you can put html into a <button></button>)
    • And another page describing why people avoid <button></button> (Hint: IE6)

    Another IE problem when using <button />:

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(14条)

报告相同问题?

悬赏问题

  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条