【问题标题】:dynamically resize custom form[submit] with CSS as the browser width/height changes?随着浏览器宽度/高度的变化,使用 CSS 动态调整自定义表单 [提交] 的大小?
【发布时间】:2014-01-02 23:40:27
【问题描述】:

使用 CSS 动态调整图像大小似乎很容易。如果我尝试使用自定义提交按钮,提交按钮会显得非常小。

<form>
    <input type="submit" name="submit" value="" id="submitID">
</form> 

-

html{height:100%;}
body{height:100%; width:100%;}

#submitID{
  background:url(../images/button.png);
  max-width:100%;
  height:auto;
  background-repeat:no-repeat;
  border:none;
  cursor:pointer;
}

【问题讨论】:

    标签: html css dynamic resize submit


    【解决方案1】:

    您的 CSS 背景图像不会拉伸。

    包含 IMG 标签的 BUTTON 怎么样:

    <button type="submit" name="submit" value="" id="submitID">
      <img src="" />
    </button>
    

    然后你可以改为控制IMG标签的大小。

    【讨论】:

      猜你喜欢
      • 2011-06-08
      • 1970-01-01
      • 1970-01-01
      • 2012-10-05
      • 2014-01-31
      • 2013-05-20
      • 2011-04-17
      • 2017-09-14
      • 1970-01-01
      相关资源
      最近更新 更多