I need round corners on a parent div to mask content from its childen. overflow: hidden
works in simple situations, but breaks in webkit based browsers and Oper
Seems this one works:
.wrap {
-webkit-transform: translateZ(0);
-webkit-mask-image: -webkit-radial-gradient(circle, white 100%, black 100%);
}
http://jsfiddle.net/qWdf6/82/
Add a z-index to your border-radius'd item, and it will mask the things inside of it.
Supported in latest chrome, opera and safari, you can do this:
-webkit-clip-path: inset(0 0 0 0 round 100px);
clip-path: inset(0 0 0 0 round 100px);
You should definitely check out the tool http://bennettfeely.com/clippy/!
Not an answer, but this is a filed bug under the Chromium source: http://code.google.com/p/chromium/issues/detail?id=62363
Unfortunately, doesn't look like there's anyone working on it. :(
based on graycrow's excellent answer...
Here's a more real world example that has two cicular divs with some filler content. I replaced the hard-coded png background with just a hex value, i.e.
-=-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
is replaced with
-webkit-mask-image:#fff;
See this JSFiddle... http://jsfiddle.net/hqLkA/
opacity: 0.99; on wrapper solve webkit bug