简体   繁体   English

在IE中,“提交”按钮周围有紫色边框,但在Chrome中没有。 如何在IE中摆脱它?

[英]Submit button has purple border around it in IE, but not in Chrome. How do I get rid of it in IE?

My Submit button has purple border around it in IE, but not in Chrome. 在IE中,“我的提交”按钮周围有紫色边框,但在Chrome中却没有。 How do I get rid of it in IE? 如何在IE中摆脱它?

Image: (Top one is in IE, Bottom one is in Chrome - I just cropped it into an image) http://i.imgur.com/Qb6pI.png 图片:(顶部在IE中,底部在Chrome中-我只是将其裁剪为图像) http://i.imgur.com/Qb6pI.png

My code is: 我的代码是:

HTML: HTML:

<div style="float:right; border:0px;">
    <input type="submit" class="submitorder"/>
</div>

CSS: CSS:

.submitorder {
background-image: url('https://www.amleo.com/images/art/SubmitOrderSprite.png');
background-position: 0px 0px;
width: 205px;
height: 52px;
font-size:0px;
}

.submitorder:hover {
background-position: 0px -62px;
}

It looks like you're removing the border on the div, not on the input. 看起来您正在删除div上的边框,而不是输入上的边框。 Modify your CSS to the following: 将CSS修改为以下内容:

.submitorder {
    background-image: url('https://www.amleo.com/images/art/SubmitOrderSprite.png');
    background-position: 0px 0px;
    width: 205px;
    height: 52px;
    font-size:0px;
    border: 0 none;
}

That should sort you out. 那应该把你整理出来。

try the following code *border :none; 试试下面的代码* border:none; / for ie7 / / 对于ie7 /

_border:none; _border:none; / for ie6 / / 对于ie6 /

border:none \\0/IE9; 边框:无\\ 0 / IE9; / * ie9 specific not sure* / / * ie9具体不确定* /

i can't actually see the purple you are speaking of by it's a common problem with IE. 我实际上看不到您所说的紫色,这是IE的常见问题。 You could get rid of it just by adding border:none to your CSS. 您可以通过在CSS中添加border:none来摆脱它。

First off, inline styles are never good practice. 首先,内联样式绝不是好习惯。

As for the border, try: 至于边界,请尝试:

.submitorder {
border: none;
background-image: url('https://www.amleo.com/images/art/SubmitOrderSprite.png');
background-position: 0px 0px;
width: 205px;
height: 52px;
font-size:0px;
}

Fore IE try adding outline: 0; IE浏览器尝试添加outline: 0; & border:none border:none

.submitorder {
background-image: url('https://www.amleo.com/images/art/SubmitOrderSprite.png');
background-position: 0px 0px;
width: 205px;
height: 52px;
font-size:0px;
outline:none;
border:none;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM