12 - CSS3 - 边框圆角 - 安卓机器猫


本文是针对刚学编程的小白,都是一些基础知识,如果想了解更多深层一点的东西,欢迎移步本人博客!!
博客地址 点击跳转


< ! ---------- HTML ----------- >

<div class="android">
    <div class="head">
        <div class="head-left-eye"></div>
        <div class="head-right-eye"></div>
        <div class="head-left-ant"></div>
        <div class="head-right-ant"></div>
    </div>
    <div class="body">
        <div class="body-left-arm"></div>
        <div class="body-right-arm"></div>
        <div class="body-left-leg"></div>
        <div class="body-right-leg"></div>
    </div>
</div>

< ! --------- Style --------------- >

<style>
    *{
        margin: 0;
        padding: 0;
    }
    .android{
        width: 400px;
        height: 400px;
        border: 1px solid #000;
        margin: 100px auto;
        position: relative;
    }
    .android .head{
        width: 200px;
        height: 100px;
        background-color: #a3c939;
        position: absolute;
        left: 50%;
        margin-left:-100px;
        border-top-left-radius: 100px;
        border-top-right-radius: 100px;
    }
    .android .head .head-left-eye{
        width: 20px;
        height: 20px;
        background-color: white;
        border-radius: 50%;
        position: absolute;
        left: 50px;
        top: 50px;
    }
    .android .head .head-right-eye{
        width: 20px;
        height: 20px;
        background-color: white;
        border-radius: 50%;
        position: absolute;
        right: 50px;
        top: 50px;
    }
    .android .head .head-left-ant{
        width: 10px;
        height: 50px;
        background-color: #a3c939;
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
        position: absolute;
        left: 40px;
        top: -35px;
        transform: rotateZ(-30deg);
    }
    .android .head .head-right-ant{
        width: 10px;
        height: 50px;
        background-color: #a3c939;
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
        position: absolute;
        right: 40px;
        top: -35px;
        transform: rotateZ(30deg);
    }
    .android .body{
        width: 200px;
        height: 220px;
        background-color: #a3c939;
        position: absolute;
        left: 50%;
        margin-left:-100px;
        top: 110px;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
    }
    .android .body .body-left-arm{
        width: 40px;
        height: 200px;
        background-color: #a3c939;
        border-radius: 20px/20px;
        position: absolute;
        top: 0;
        left: -50px;
    }
    .android .body .body-right-arm{
        width: 40px;
        height: 200px;
        background-color: #a3c939;
        border-radius: 20px/20px;
        position: absolute;
        top: 0;
        right: -50px;
    }
    .android .body .body-left-leg{
        width: 50px;
        height: 100px;
        background-color: #a3c939;
        border-radius: 25px/25px;
        position: absolute;
        left: 30px;
        bottom: -70px;
    }
    .android .body .body-right-leg{
        width: 50px;
        height: 100px;
        background-color: #a3c939;
        border-radius: 25px/25px;
        position: absolute;
        right: 30px;
        bottom: -70px;
    }
    .android .head:hover{
        transform: rotateZ(-10deg);
        transform-origin: left bottom;
    }
    .android .body:hover .body-left-arm{
        transform: rotateZ(180deg);
        transform-origin: 20px 50px;
    }
</style>

< ! --------- 效果展示 ---------- >

**机器猫**
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,937评论 25 709
  • 发现 关注 消息 iOS 第三方库、插件、知名博客总结 作者大灰狼的小绵羊哥哥关注 2017.06.26 09:4...
    肇东周阅读 14,375评论 4 61
  • 学而时习之,温故而知新。本周考了4天的试,今天终于拿出一天的时间来好好回顾总结一下。 怎么说呢?就是一句话,我应该...
    钟曜阅读 1,342评论 0 0
  • 1.当我跑步的时候我很快乐,很开心,每天跑步60分钟。 2.当我跑步完了以后我感觉到很轻松,那种舒畅感让我觉得跑步...
    我是孟祥勇阅读 1,666评论 0 0
  • 一次慈善乞讨 你是不是感觉这个名字很奇怪?不是的,这是我人生的一次经历,也是一次人生的蜕变。 这个故事,还的从去年...
    卢尚华O2O新茶商阅读 1,513评论 0 0

友情链接更多精彩内容