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;
    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>

969404-20190313195114816-1801239719.png

转载于:https://www.cnblogs.com/Tobenew/p/10525722.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值