Implementation ideas:
(Recommended tutorial: css quick start)
Two divs side by side, in the second Define a div named item with 2 times the width and height, set border-radius: 50% for the item, and then absolutely position it.
Code implementation:
<head> <meta charset="UTF-8" /> <title>Title</title> <style> .box { width: 50px; height: 50px; overflow: hidden; background: #655; text-align: center; position: relative; float: left; } .item { width: 100px; height: 100px; background: #fff; border-radius: 50%; position: absolute; top: -50px; left: 0; } </style> </head> <body> <div class="box"></div> <div class="box"> <div class="item"></div> </div> </body> </html>
Implementation effect:
The above is the detailed content of How to achieve rounded corners and concave effect in css. For more information, please follow other related articles on the PHP Chinese website!