IE7-8:“清晰”与输入类型=“文件”高度相同的按钮“浏览”按钮

发布于 2024-10-09 06:59:23 字数 792 浏览 0 评论 0原文

这是我的测试(精简到最小值)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
    <style type="text/css">
        .file-form-active-inputs { margin-left : 2px; } 
    </style>
    <title></title>
  </head>
  <body>
    <form>
      <input type="file" name="_206_0_100070" size="60" id="HASH(0x331b400)" class="form-active-inputs">  
      <button class="file-form-active-inputs">
        Button with same height as 'browse' button to the left
      </button>
    </form>
  </body>
</html>

有没有办法将按钮高度

与 IE7-8 输入 type="file" "browse" 按钮高度相匹配?

Here is my test (stripped down to minimum)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
    <style type="text/css">
        .file-form-active-inputs { margin-left : 2px; } 
    </style>
    <title></title>
  </head>
  <body>
    <form>
      <input type="file" name="_206_0_100070" size="60" id="HASH(0x331b400)" class="form-active-inputs">  
      <button class="file-form-active-inputs">
        Button with same height as 'browse' button to the left
      </button>
    </form>
  </body>
</html>

Is there any way to match button height

to a IE7-8 input type="file" "browse" button height?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

虐人心 2024-10-16 06:59:23

假设您只是想确保按钮匹配,一种可能的黑客方法是不要尝试将透明按钮的高度与文件上传按钮匹配,而是将文件上传按钮的样式设置为与透明按钮的高度匹配按钮。以下技巧向您展示了如何使用 CSS 或 Javascript 来执行此操作。

如果您决定采用这种方法,我建议您使用 Javascript,因为它允许您为所有其他浏览器提供干净的标记,但仅添加适用于 IE 的附加元素。

希望有人可以使用一些简单的 CSS 来完成您最初要求的操作,而不必遵循此技术,因为它涉及更多工作。

祝你好运

Assuming that you just want to make sure that the buttons match, one possible hackish way to do this is instead of trying to match the height of your clear button to the File Upload button, you style the File Upload button to match that of the clear button. The following Trick shows you how to do this using CSS or Javascript.

If you decide to follow this approach I would recommend that you do it with Javascript, because it allows you to have clean markup for all other browsers, but add in the additional elements only for IE.

Hopefully someone has some simple CSS to do what you are originally asking for rather than having to follow this technique, since it involves more work.

Good Luck

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文