css画冰棍儿

作者: _Dot912 | 来源:发表于2017-07-19 21:16 被阅读0次
<!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>icecream</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            background: #afeeee;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .icecream {
            position: relative;
            height: 900px;
            width: 600px;
        }

        .top {
            position: absolute;
            border: 3px solid transparent;
            width: 300px;
            transform: translateX(-50%);
            border-radius: 50% 50% 0 10%/40% 40% 0 8%;
        }

        .top-out {
            border-left: 15px solid #ff38b4;
            background: #ff69b4;
            height: 450px;
            top: 100px;
            left: 50%;
            z-index: 3;
        }

        .top-in {
            background: #fe99ef;
            height: 455px;
            top: 95px;
            left: 55%;
            z-index: 1;
            border-bottom-right-radius: 10% 8%;
        }

        .middle {
            position: absolute;
            background: white;
            border: 3px solid transparent;
            height: 50px;
            width: 335px;
            top: 525px;
            left: 52%;
            transform: translateX(-50%);
            border-bottom-left-radius: 10% 70%;
            border-bottom-right-radius: 10% 70%;
        }

        .bottom {
            position: absolute;
            background: #f4a460;
            height: 200px;
            width: 50px;
            top: 570px;
            left: 51%;
            transform: translateX(-50%);
            border-bottom-left-radius: 50% 10%;
            border-bottom-right-radius: 50% 10%;
            border-bottom: 30px solid #cd853f;
            border-top: 30px solid #cd853f;
            z-index: 2;
        }

        .shadow {
            position: absolute;
            background: #ff38b4;
            height: 250px;
            width: 30px;
            top: 220px;
            border: 10px solid transparent;
            z-index: 3;
            border-radius: 50%/10%;
        }

        .shadow1 {
            left: 40%;
        }

        .shadow2 {
            right: 38%;
        }
    </style>
</head>

<body>
    <div class="icecream">
        <div class="top top-out"></div>
        <div class="top top-in"></div>
        <div class="middle"></div>
        <div class="bottom"></div>
        <div class="shadow shadow1"></div>
        <div class="shadow shadow2"></div>
    </div>
</body>

</html>

相关文章

  • css画冰棍儿

  • 卖冰棍儿喽~~~【冰棍儿】的英文你会说么

    冰棍儿 popsicle / ice cream bar 炎炎夏日,何以解忧(暑)?当然是——冰棍儿! 冰棍儿,也...

  • 冰棍儿往事

    “冰棍儿,卖冰棍儿,谁买冰棍儿……”每到夏天,这种熟悉的声音就在耳畔不断回响,让我一次次想到冰棍儿。 印象中小时候...

  • 【总结】2016.12.19

    计划的任务 css画icon css border-radius css box-shadow 部分页面加载更多的...

  • 【转】用CSS画各种形状(一)

    本篇是以下两篇文章的转载和总结 纯CSS画基本形状用CSS画三角形,普通版,文艺小阴影版~ 1、画方形 2、画正圆...

  • 美丽家乡辣椒情怀之二*温情移栽

    “冰棍儿……冰棍儿……老冰棍儿……二分钱一根……快来买呀……消暑解渴类……。”五月夏收,骄阳似火,大路上的柏...

  • 小孩的诗

    妈妈 你看月亮 象冻坏了的冰棍儿 幸好我的冰棍儿 还好好的

  • 冰棍

    没有冰棍儿的六月 有点热 舔上冰棍儿的六月 暗自窃喜

  • 【每日一图】一品难忘 唇齿留香

    主题【图形】 •冰棍 【今日摄影思路】 ① 冰棍儿。 ② 手握冰棍儿木柄,墙纸为背景,靠窗边,自然光。 ③竖构图,...

  • 冰棍儿的夏天

    作者/紫瓶子 一大波冰棍儿正向你袭来! 夏天——一个尽情吃冰棍儿的季节!

网友评论

    本文标题:css画冰棍儿

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