样式如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>cysky</title>
<style>
*{
padding: 0;
margin: 0;
}
body{
background-color: #ccc;
}
.content{
width: 500px;
height: 500px;
border: 1px solid #000;
margin: 100px auto 0;
}
.header{
width: 250px;
height: 125px;
border-radius: 125px 125px 0 0;
margin: 10px auto;
background-color: darkgreen;
position: relative;
}
.header::before,.header::after{
content:"";
display: block;
position: absolute;
width: 20px;
height: 20px;
top:60px;
background-color: #fff;
border-radius: 50%;
}
.header::before{
left: 60px;
}
.header::after{
right: 60px;
}
.body{
width: 250px;
height: 250px;
background-color: darkgreen;
border-radius: 0 0 20px 20px;
margin:0 auto;
position: relative;
}
.body::before,.body::after{
content: '';
display: block;
width: 30px;
height: 180px;
border-radius: 8px;
background-color: darkgreen;
position: absolute;
top: 20px;
}
.body::before{
left: -40px;
}
.body::after{
right: -40px;
}
.footer{
width: 250px;
height: 100px;
margin: 0 auto;
position: relative;
}
.footer::before,.footer:after{
content: '';
display: block;
width: 30px;
height: 90px;
background-color: darkgreen;
position: absolute;
top: 0;
border-radius: 0 0 10px 10px;
}
.footer::before{
left: 50px;
}
.footer:after{
right:50px;
}
</style>
</head>
<body>
<div class="content">
<div class="header"></div>
<div class="body"></div>
<div class="footer"></div>
</div>
</body>
</html>