有什么方法可以删除活动表单中提交按钮周围的IE黑色边框? [英] Any way to remove IEs black border around submit button in active forms?
问题描述
我正在实施一个使用自定义样式提交按钮的设计.它们是非常简单的浅灰色按钮,外边框稍暗:
I am implementing a design that uses custom styled submit-buttons. They are quite simply light grey buttons with a slightly darker outer border:
input.button {
background: #eee;
border: 1px solid #ccc;
}
这在 Firefox、Safari 和 Opera 中看起来恰到好处.问题出在 Internet Explorer 6 和 7 上.
This looks just right in Firefox, Safari and Opera. The problem is with Internet Explorer, both 6 and 7.
由于表单是页面上的第一个表单,因此它被视为主表单 - 因此从一开始就处于活动状态.活动表单中的第一个提交按钮在 IE 中收到一个纯黑色边框,以将其标记为主要操作.
Since the form is the first one on the page, it's counted as the main form - and thus active from the get go. The first submit button in the active form receives a solid black border in IE, to mark it as the main action.
如果我关闭边框,那么 IE 中的黑色额外边框也会消失.我正在寻找一种方法来保持我的正常边框,但删除轮廓.
If I turn off borders, then the black extra border in IE goes away too. I am looking for a way to keep my normal borders, but remove the outline.
推荐答案
这里有效:
<html>
<head>
<style type="text/css">
span.button {
background: #eee;
border: 1px solid #ccc;
}
span.button input {
background:none;
border:0;
margin:0;
padding:0;
}
</style>
</head>
<body>
<span class="button"><input type="button" name="..." value="Button"/></span>
</body>
</html>
这篇关于有什么方法可以删除活动表单中提交按钮周围的IE黑色边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!