IE7-8:“清晰”与输入类型=“文件”高度相同的按钮“浏览”按钮
这是我的测试(精简到最小值)
<!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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您只是想确保按钮匹配,一种可能的黑客方法是不要尝试将透明按钮的高度与文件上传按钮匹配,而是将文件上传按钮的样式设置为与透明按钮的高度匹配按钮。以下技巧向您展示了如何使用 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