随笔 - 434,  文章 - 0,  评论 - 463,  阅读 - 46万

效果图

练习代码

.face {
    width: 600px;
    height: 320px;
    background: #FEE443;
    position: relative;
}

.eye {
    width: 60px;
    height: 60px;
    border-radius: 100%;
    background: #222;
    position: absolute;
}

.eye-l  {
    left: 105px;
    top: 100px;
}

.eye-r  {
    right: 105px;
    top: 100px;
}

.eye .bright {
    width: 30px;
    height: 30px;
    position: absolute;
    background: #fff;
    border-radius: 50%;
}

.norse  {
    width: 0px;
    height: 0px;
    border: 18 px solid #000;
    border-radius: 50%;
    transform: translateX(-50%);
    left: 50%;
    top: 52%;
    border-color: #000  #a9505000 transparent;
    position: absolute;
}

.lip-l  {
    width: 50px;
    height: 50px;
    border: 4 px solid #000;
    position: absolute;
    background: red;
    border-radius: 50%;
    top: 66%;
    left: 10%;
}

.lip-r  {
    width: 50px;
    height: 50px;
    border: 4 px solid #000;
    position: absolute;
    background: red;
    border-radius: 50%;
    top: 66%;
    right: 10%;
}

.mouth {
    overflow: hidden;
    width: 150px;
    height: 60px;
    background: transparent;
    position: absolute;
    left: 50%;
    bottom: 10%;
    margin-left: -68px;
}

.mouth .a  {
    top: -30px;
    position: absolute;
    width: 60px;
    height: 60px;
    border: 6 px solid #222;
    border-radius: 50%;
}

.mouth .b  {
    top: -30px;
    position: absolute;
    left: 65px;
    width: 60px;
    height: 60px;
    border: 6 px solid #222;
    border-radius: 50%;
}

html:

主要还是绝对定位还有圆角属性,比较基础,不喜勿喷。

posted on   剽悍一小兔  阅读(39)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示