CSS3---9.⽤CSS3属性绘制安卓机器⼈<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>安卓机器⼈</title>
</head>
<style>
.android{
width: 500px;
height: 500px;
border: 1px solid #ccc;
margin: 100px auto;
}
.head {
position: relative;
width: 250px;
height: 125px;margin属性怎么用
background-color: yellowgreen;
margin: 0px auto 10px;
border-radius: 125px 125px 0 0;
}
.head::before,.head::after{
content: "";
width: 20px;
height: 20px;
border-radius: 50%;
background-color: #fff;
position: absolute;
bottom: 40px;
}
.head::before{
left: 60px;
}
.head::after{
right: 60px;
}
.body{
position: relative;
width: 250px;
height: 250px;
background-color: yellowgreen;
margin: 0 auto;
border-radius: 0 0 20px 20px ;
}
.body::before,.body::after{
content: "";
position: absolute;
background-color: yellowgreen;
width: 30px;
height: 180px;
border-radius: 10px;
top:20px;
}
.
body::before{
left:-40px;
}
.body::after{
right:-40px;
}
.foot{
position: relative;
margin: 0 auto;
width: 250px;
height: 125px;
}
.foot::before,.foot::after{
content: "";
position: absolute;
background-color: yellowgreen;
width: 30px;
height: 100px;
border-radius:0 0 10px 10px;
top:0px;
}
.foot::before{
left:60px;
}
.foot::after{
right:60px;
}
</style>
<body>
<div class="android">
<div class="head"></div>        <div class="body"></div>        <div class="foot"></div>    </div>
</body>
</html>

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。