简体   繁体   中英

How to make the image also have rounded corners?

I've been trying to make the image's corner also be rounded but when I apply border-radius on the div, the image corner dosen't change at all.

 #bredband { height: 330px; width: 300px; position: relative; background-color: #9099A2; margin: 20px; float:left; border-radius:10px; } 
 <div id="bredband"> <img src="https://upload.wikimedia.org/wikipedia/commons/2/21/Corinex_Router.jpg" width="300" height="200"> <h3>Bredband</h3> <p>hello world</p> </div> 

图片

Add overflow: hidden; to your #bredband selector. That should clip the top corners.

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