使用边框半径为 20 像素的背景图像时,表单按钮上的轮廓模糊

发布于 2024-12-06 10:38:05 字数 1265 浏览 2 评论 0原文

由于某种原因,仅在 Windows 计算机上,在此页面上的“登录”按钮上,我得到了这个奇怪的模糊轮廓,很难解释,所以请亲自查看:

http://zis.smartlyedu.com/login

它不会出现在 Mac OS 上,但会出现在 Windows 上。

以前有人遇到过这种情况吗?

这是按钮的 CSS:

    div.input-submit input{
    outline:none;
    font-family:Helvetica, Arial, sans-serif;
    width:100px;
    height:35px;
    color:#fff;
    font-weight:normal;
    float:right;
    font-size:18px;
    text-shadow:#000 1px 1px 1px;
    border:1px solid #fff;
    -moz-border-radius:20px;
    -webkit-border-radius:20px;
    -o-border-radius:20px;
    -ms-border-radius:20px;
    -khtml-border-radius:20px;
    border-radius:20px;
    background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(0,0,0,0)), color-stop(100%, rgba(0,0,0,0.2)));
    background:-webkit-linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.2));
    background:-moz-linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.2));
    background:-o-linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.2));
    background:-ms-linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.2));
    background:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.2));
    background-color:#31639d;
    font-weight:bold;
    border:1px solid #fff
    }

For some reason, exclusively on Windows machines, on the Sign in button on this page, I'm getting this odd fuzzy outline that's difficult to explain, so see for yourself:

http://zis.smartlyedu.com/login

It doesn't appear on Mac OS, but it does on Windows.

Has anyone encountered this before?

Here is the CSS for the button:

    div.input-submit input{
    outline:none;
    font-family:Helvetica, Arial, sans-serif;
    width:100px;
    height:35px;
    color:#fff;
    font-weight:normal;
    float:right;
    font-size:18px;
    text-shadow:#000 1px 1px 1px;
    border:1px solid #fff;
    -moz-border-radius:20px;
    -webkit-border-radius:20px;
    -o-border-radius:20px;
    -ms-border-radius:20px;
    -khtml-border-radius:20px;
    border-radius:20px;
    background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(0,0,0,0)), color-stop(100%, rgba(0,0,0,0.2)));
    background:-webkit-linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.2));
    background:-moz-linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.2));
    background:-o-linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.2));
    background:-ms-linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.2));
    background:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.2));
    background-color:#31639d;
    font-weight:bold;
    border:1px solid #fff
    }

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

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

发布评论

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

评论(1

迷爱 2024-12-13 10:38:05

这个解决方案是通过原始帖子的评论找到的。

Alain,将 display:none 添加到输入元素以确认轮廓源自输入元素。如果您确定来源的原因,请禁用与您的元素匹配的选择器的所有 CSS 属性,然后将它们单独添加回来。这样,您将能够找到 CSS 问题的原因。

Jason McCreary 回复:

谢谢,我尝试了你的方法,发现问题出在
1px 边框和 20px 边框半径。显然是在 Windows 上
如果它们在提交按钮上同时使用,就会很奇怪。修复
它,我所做的就是删除边框并将其替换为边框:
没有任何;。如果我删除边框半径,它也会工作得很好。谢谢
寻求帮助!

This solution has been found through comments at the original post.

Alain, add display:none to the input element to confirm that the outline is originating from the input element. If you're sure about the origin's cause, disable all CSS attributes of the selectors which match your element, and add them back individually. This way, you will be able to find the cause of your CSS issue.

Jason McCreary responded:

Thanks, I tried your method and I found out that the issue was with
the 1px border and the 20px border-radius. Apparently on Windows it
freaks out if they're used at the same time on a submit button. To fix
it, all I did was remove the borders and replace it with border:
none;. If I removed the border-radius it would work fine, too. Thanks
for the help!

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