Home >Web Front-end >CSS Tutorial >How to Fix Overflow:hidden Issues with Rounded Corners in Chrome and Opera?
CSS3 Rounded Corners and Overflow Masking in Chrome and Opera
The challenge arises when trying to hide content overflowing from its child elements using rounded corners on a parent div. While overflow: hidden works in most browsers, it encounters issues in WebKit-based browsers like Chrome and Opera when the parent element is positioned relatively or absolutely.
To resolve this problem, a solution has emerged that involves adding a WebKit CSS Mask to the parent element (#wrapper). This mask utilizes a single-pixel PNG image, which can be embedded directly into the CSS to eliminate unnecessary HTTP requests. By applying this workaround, overflow: hidden functionality is restored in Chrome and Opera, effectively concealing any content extending beyond the rounded corners.
The above is the detailed content of How to Fix Overflow:hidden Issues with Rounded Corners in Chrome and Opera?. For more information, please follow other related articles on the PHP Chinese website!