有时我们需要一个容器,只在内侧有圆角,而边框或描边的四个角在外部仍然保持直角的形状,
视图
代码段:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>边框内圆角</title>
<style>
#box1{
background:blue;
width: 200px;
padding: 20px;
}
.xbox2{
background-color:white;
border-radius: 5px;
padding: 5px;
}
</style>
</head>
<body>
<div id="box1">
<div class="xbox2">
我要写一个圆角边框
</div>
</div>
</body>
</html>