简体   繁体   中英

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. This works in Firefox as well as to round the corners (in chrome) before the hover, however on hover my corners square up. Am I missing something? My HTML consists of a standard 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-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-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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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