带有 css 背景和圆形边框的 Firefox 溢出错误
我正在尝试设计一个具有橙色背景和圆形边框的按钮,但问题是背景溢出。我在 Chrome 上看不到任何问题。
我使用了 overflow:hidden
但没有帮助。有什么想法吗?
这是代码:
display: inline-block;
padding: 8px 15px 6px;
background: -moz-linear-gradient(top, #f8cc55, #ba701d);
background: -webkit-linear-gradient(#f8cc55, #ba701d);
background: -o-linear-gradient(#f8cc55, #ba701d);
background: -ms-linear-gradient(#f8cc55, #ba701d);
background: linear-gradient(#f8cc55, #ba701d);
color: #1f2b20;
text-shadow: 0 1px 0 #e3bf8b;
font-size: 14px;
border-radius: 15px;
border: 3px solid #2e2e2e;
box-shadow: 0 1px 0 #fff inset;
火狐
I'm trying to design a button with orange background and rounded borders but the problem is background overflows. I cant see any problem on Chrome.
I used overflow: hidden
but no help. Have any idea?
Here is the code:
display: inline-block;
padding: 8px 15px 6px;
background: -moz-linear-gradient(top, #f8cc55, #ba701d);
background: -webkit-linear-gradient(#f8cc55, #ba701d);
background: -o-linear-gradient(#f8cc55, #ba701d);
background: -ms-linear-gradient(#f8cc55, #ba701d);
background: linear-gradient(#f8cc55, #ba701d);
color: #1f2b20;
text-shadow: 0 1px 0 #e3bf8b;
font-size: 14px;
border-radius: 15px;
border: 3px solid #2e2e2e;
box-shadow: 0 1px 0 #fff inset;
Firefox
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能想在 Firefox 中使用是
background-clip
:这是一个示例。请记住,
background
属性将重置任何未指定的子属性的值,因此请将background-clip
最后放置。What you probably want to use in Firefox is
background-clip
:Here's an example. Remember the
background
property will reset values for any of the sub-properties not specified, so putbackground-clip
last.如果
box-shadow
不是必需的,请将其删除。这将解决这个问题:)If the
box-shadow
is not mandatory, remove it. That will fix the issue :)