美文网首页
css3练习:恐龙

css3练习:恐龙

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

前天在做每周一练时,还练习了一个绿色的恐龙。

本来想放在十二生肖里,但觉得恐龙虽然是龙,但却不属于中国龙吧。

这几天在练小程序,工作上虽没什么事做,但自己学的好开心,天天边学边打。

以前自己只要一学习,就会有新工作来,总不让踏实学习。

现在总算有时间好好学习了,有得有失吧。

但自己蛮开心的。

这学习果然还是要像之前那样,要边练习,边学习,不管你懂不懂。先打出来,然后再思考。

最近已经小有成果。哈。。。。。。。

<div class="dragon">

    <div class="face">

        <div class="eyes"></div>

        <div class="mouth">

            <div class="teeth1"></div>

            <div class="teeth2"></div>

            <div class="teeth3"></div>

            <div class="teeth4"></div>

        </div>

        <div class="neck"></div>

        <div class="scales">

            <div class="s1"></div>

            <div class="s2"></div>

            <div class="s3"></div>

            <div class="s4"></div>

        </div>

        <div class="body"></div>

        <div class="tail"></div>

        <div class="leg">

            <div class="left"></div>

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

        </div>

    </div>

body {

    font-size: 10px;

    background: white;

    margin: 10em;

}

.dragon {

    position: relative;

    display: flex;

    align-items: center;

    justify-content: center;

}

.dragon *::before,

.dragon *::after {

    content: '';

    position: absolute;

}

.dragon .face {

    background-color: green;

    height: 80px;

    width: 110px;

    border-radius: 20px 35px 35px 20px;

    position: relative;

}

.dragon .eyes::before {

    width: 20px;

    height: 22px;

    background: radial-gradient( circle at 50% 50%, black 0.5em, transparent 0.5em), radial-gradient( circle at 50% 40%, white 1.7em, transparent 1.7em), white;

    border-radius: 50%;

    top: 15px;

    left: 55px;

}

.dragon .mouth {

    background-color: #fff;

    height: 3px;

    width: 40px;

    position: relative;

    top: 45px;

    left: 69px;

    transform: rotate(-10deg);

}

.teeth1,

.teeth2,

.teeth3,

.teeth4 {

    height: 0;

    width: 0;

    position: relative;

}

.teeth1 {

    border-top: 12px solid #fff;

    border-left: 7px solid transparent;

    border-right: 7px solid transparent;

    left: 27.5px;

}

.teeth2 {

    border-top: 12px solid #fff;

    border-left: 7px solid transparent;

    border-right: 7px solid transparent;

    bottom: 11px;

    left: 15px;

}

.teeth3 {

    border-top: 12px solid #fff;

    border-left: 7px solid transparent;

    border-right: 7px solid transparent;

    bottom: 23px;

    left: 6px;

}

.teeth4 {

    border-top: 12px solid #fff;

    border-left: 5px solid transparent;

    border-right: 5px solid transparent;

    bottom: 36px;

    right: 1px;

}

.dragon .neck {

    background-color: green;

    height: 200px;

    width: 50px;

    border-radius: 20px;

    position: relative;

    top: 0px;

    right: 10px;

    transform: rotate(4deg);

}

.scales {

    position: relative;

    top: -10px;

    z-index: -1;

}

.s1,

.s2,

.s3,

.s4 {

    height: 0;

    width: 0;

    border-right: 20px solid green;

    border-top: 10px solid transparent;

    border-bottom: 10px solid transparent;

    transform: rotate(7deg);

    position: relative;

}

.s1 {

    bottom: 180px;

    right: 21px;

}

.s2 {

    bottom: 160px;

    right: 24px;

}

.s3 {

    bottom: 140px;

    right: 27px;

}

.s4 {

    bottom: 120px;

    right: 29px;

}

.body {

    height: 150px;

    width: 250px;

    background-color: green;

    border-radius: 100px 0 30px 0;

    position: relative;

    bottom: 120px;

    right: 215px;

}

.tail {

    width: 0;

    height: 0;

    border-right: 180px solid green;

    border-top: 60px solid transparent;

    border-bottom: 0px solid transparent;

    position: relative;

    bottom: 177px;

    right: 340px;

    transform: rotate(-3deg);

}

.leg .left,

.leg .right {

    position: relative;

    top: -200px;

    left: 0;

}

.leg .left::after,

.leg .left::before,

.leg .right::after,

.leg .right::before {

    background-color: green;

    height: 65px;

    width: 37px;

}

.leg .left::before {

    left: -20px

}

.leg .left::after {

    left: -80px

}

.leg .right::before {

    left: -140px

}

.leg .right::after {

    left: -200px

}

相关文章

  • css3练习:恐龙

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

  • 恐龙

    老爸:从此恐龙一发不可收拾,每天必画,收藏了近300只恐龙模型,不断观察然后练习。

  • CSS3掷骰子动画

    CSS3掷骰子动画 练习一下css3的弹性盒布局,做了一个骰子,随便扔一下吧骰子.gif 一、拆分模块,先分别做出...

  • js笔记十之for循环练习

    练习 隔行变色(css3实现) HTML CSS 隔行变色(js实现) HTML同上 JS 选项卡 HTML CS...

  • 恐龙主题

    恐龙 恐龙 我们爱恐龙 主题阅读-恐龙

  • 网页高级知识点(三)

    CSS3 transition动画 CSS3 transform变换 CSS3 animation动画

  • CSS3-目录

    1 CSS3 兼容性 2 CSS3 选择器 3 CSS3 新加属性 4 CSS3 过渡动画 5 CSS3 变型 6...

  • CSS3 背景

    知识点: CSS3 背景图像区域CSS3 背景图像定位CSS3 背景图像大小CSS3 多重背景图像CSS3 背景属...

  • 宝仔讲故事之恐龙吃早餐

    我今天要讲恐龙吃早餐的故事! 恐龙爸爸去买米粉了,他拿不了那么多,恐龙妈妈的,恐龙哥哥的,恐龙姐姐的,恐龙...

  • “ 恐龙一家”成长始记

    儿子喜欢恐龙,一次看恐龙画本的时候,指点角色:“爸爸,我是恐龙宝宝,你是恐龙爸爸,妈妈是恐龙妈妈,看看恐龙宝宝可爱...

网友评论

      本文标题:css3练习:恐龙

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