简体   繁体   English

Chrome 忽略了我在 hover 上的菜单的圆角

[英]Chrome is ignoring the rounded corners of my menu on hover

I'm having an issue with Chrome ignoring the rounded corners of my menu on hover.我遇到了 Chrome 忽略 hover 上菜单的圆角的问题。 This works in Firefox as well as to round the corners (in chrome) before the hover, however on hover my corners square up.这适用于 Firefox 以及在 hover 之前圆角(镀铬),但是在 hover 上我的角向上。 Am I missing something?我错过了什么吗? My HTML consists of a standard ul.我的 HTML 由标准 ul 组成。

#nav > ul > li:first-child a:hover {
-moz-border-radius-bottomleft: 4px;
-webkit-border-radius-bottomleft: 4px !important;
-border-bottom-left-radius: 4px !important;
-moz-border-radius-topleft: 4px;
-webkit-border-radius-topleft: 4px !important;
-border-top-left-radius: 4px !important;
background: url(../images/menu-back-hover.png) repeat-x;
}

The selector for webkit browsers (ie chrome) should be: webkit 浏览器(即 chrome)的选择器应该是:

-webkit-border-top-left-radius:  4px;
-webkit-border-bottom-left-radius:  4px;

The following applied to the parent element with the border radius applied to kick webkit back into line for me:以下适用于父元素,边框半径适用于将 webkit 踢回对我来说:

-webkit-mask-image: -webkit-radial-gradient(white, black);

Another option is to wrap the element in two border radius parents.另一种选择是将元素包装在两个边界半径父项中。

Seems hacky to me, but far better than the double wrap option – interested to hear other solutions.对我来说似乎很老套,但比双包装选项要好得多——有兴趣听听其他解决方案。

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

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