美文网首页
CSS每周一练:龙

CSS每周一练:龙

作者: 0清婉0 | 来源:发表于2021-03-20 13:29 被阅读0次

每周一练,十二生肖--龙

<!--龙-->

<div class="dragon">

    <div class="head">

        <div class="hair_left"></div>

        <div class="hair_right"></div>

        <div class="horn"></div>

        <div class="poke">

            <div class="right"></div>

        </div>

        <div class="face_left">

            <div class="eye"></div>

        </div>

        <div class="face_right">

            <div class="eye"></div>

        </div>

        <div class="snout">

            <div class="wrap">

                <div class="nose"></div>

            </div>

        </div>

    </div>

</div>

body{font-size: 10px;background:teal;margin:10em;}

.dragon {

    position:relative;

    display: flex;

    align-items: center;

    justify-content: center;

}

.dragon *::before,

.dragon *::after{

    content:'';

    position: absolute;

}

.head{

    position: absolute; z-index: 1;

    width: 0px; height: 0px;

    border: 20px solid transparent;

    border-top: 20px solid #F97100;

    border-right: 20px solid #F97100;

    transform: scale(1.1);

}

.hair_left,

.hair_right{

    position: absolute;z-index: 1;

    width: 0px; height: 0px;

    border: 20px solid transparent;

    margin-top: -20px;

}

.hair_left {

    border-top: 20px solid #F97100;

    border-right: 20px solid #F97100;

    margin-left: -20px;

}

.hair_right {

    border-top: 20px solid #E03300;

    border-left: 20px solid #E03300;

    margin-left: 20px;

}

.horn {

    width: 0px; height: 0px;

    border: 7px solid transparent;

    border-bottom: 50px solid #530800;

    transform: skew(19deg);

    position: absolute;

    margin-top: -77px; margin-left: -29px;

}

.horn::after {

    width: 0px; height: 0px;

    border: 7px solid transparent;

    border-bottom: 50px solid #530800;

    transform: skew(-38deg);

    margin-top: -6px; margin-left: 79px;

}

.poke {

    width: 0px; height: 0px;

    border: 10px solid transparent;

    border-bottom: 10px solid #F97100;

    position: absolute;

    margin-top: -40px; margin-left: 10px;

}

.poke::before,

.poke::after,

.poke .right{

    width: 0px; height: 0px;

    border: 5px solid transparent;

}

.poke::before {

    border-bottom: 8px solid #F97100;

    margin-top: -3px; margin-left: -25px;

}

.poke::after {

    border-bottom: 8px solid #DF3400;

    margin-top: -3px; margin-left: 15px;

}

.poke .right {

    border-bottom: 5px solid #DF3400;

    border-left: 5px solid #DF3400;

    position: absolute;

    margin-top: 1px; margin-left: 0px;

}

.face_left,

.face_right{

    width: 0px; height: 0px;

    border-top: 10px solid transparent;

    position: absolute;

}

.face_left {

    border-left: 50px solid transparent;

    border-bottom: 50px solid #E13300;

    border-right: 10px solid #E13300;

    margin-top: -22px; margin-left: -49px;

    transform: rotate(-65deg) scaleX(0.8) scaleY(1.3);

    z-index: -1;

}

.face_right {

    border-right: 50px solid transparent;

    border-bottom: 50px solid #940000;

    border-left: 10px solid #940000;

    margin-top: -23px; margin-left: 30px;

    transform: rotate(65deg) scaleX(0.8) scaleY(1.3);

    z-index: -10;

}

.face_left .eye,

.face_right .eye{

    width: 20px; height: 20px;

    background-color: #FBC614;

    border-radius: 100%;

    position: absolute;

    margin-top: 20px; margin-left: -10px;

}

.face_left .eye {

    transform: rotate(60deg) scaleX(0.8);

    border: 3px solid #980100;

    margin-left: -17px;

}

.face_right .eye {

    transform: rotate(-60deg) scaleX(0.8);

    border: 3px solid #510700;

}

.snout {

    width: 6px; height: 0px;

    border: 9px solid transparent;

    border-bottom: 18px solid #FA7300;

    position: absolute; z-index: 2;

    margin-top: 8px; margin-left: 8px;

}

.snout::before,

.snout::after,

.snout .wrap{

    height: 25px;

}

.snout::before {

    width: 33px;

    background-color: #E23401;

    border-radius: 50px;

    margin-top: 17px; margin-left: -17px;

    z-index: 3; overflow: hidden;

}

.snout::after {

    width: 16px;

    background-color: rgba(0, 0, 0, 0.15);

    border-radius: 0px 50px 50px 0px;

    position: absolute; z-index: 100;

    margin-top: 17px; margin-left: 0px;

}

.snout .wrap {

    width: 33px;

    background-color: #E23401;

    border-radius: 50px;

    position: absolute; z-index: 3;

    margin-top: 17px; margin-left: -14px;

    overflow: hidden;

}

.nose {

    width: 15px; height: 15px;

    background-color: #540700;

    position: absolute; z-index: 4;

    margin-top: 13px; margin-left: -2px;

    border-top-right-radius: 4px;

}

.nose::before {

    width: 11px; height: 11px;

    background-color: #E23401;

    z-index: 4;

    margin-top: -7px; margin-left: 6px;

    border-radius: 4px;

    box-shadow: 0px 5px 0px #540700, 0px 10px 0px #540700;

}

.nose:after {

    width: 15px; height: 15px;

    background-color: #540700;

    margin-top: 0px; margin-left: 16px;

    z-index: 4; border-top-left-radius: 4px;

}

相关文章

  • CSS每周一练:龙

    每周一练,十二生肖--龙 ...

  • 2019-03-28

    每周一练

  • CSS每周一练:鼠

    看网上制作的小老鼠都要套好多div,我将这几天学习的知识结合了一下,用伪元素制作了一只小老鼠的头部,省却了很多代码...

  • css3练习:恐龙

    前天在做每周一练时,还练习了一个绿色的恐龙。 本来想放在十二生肖里,但觉得恐龙虽然是龙,但却不属于中国龙吧。 这几...

  • CSS3每周一练:虎

    今日完成每周一练,十二生肖-虎 ...

  • CSS3每周一练:兔

    每周一练,十二生肖--兔 运用知识点: border-radius radial-gradient transfo...

  • css3每周一练:牛

    写了一下午,小牛牛终于完成了。可参见 十二生肖-牛[https://wow.techbrood.com/fiddl...

  • 【HTTP】HTTP 的15个常见知识点复习

    前言 自从入职新公司到现在,我们前端团队内部一直在做 ?每周一练 的知识复习计划,我之前整理了一个 每周一练 之 ...

  • QQ爆款

    每日一练,每周一诊,主旨小讲,邀人奖励,话题分享。

  • “每周一练”五年级

    “每周一练”五年级 “每周一练”五年级 01 一个分数的分母是分子的3倍,请写出三个这样的分数。 02 分数五分之...

网友评论

      本文标题:CSS每周一练:龙

      本文链接:https://www.haomeiwen.com/subject/qmqwcltx.html