第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

用 CSS 3 來(lái)做個(gè)平安果吧~

標(biāo)簽:
Html/CSS

圣诞将至,我们就用 CSS 3 来做个平安果吧~ 愿所有程序猿和媛们都平安夜不加班~

进入正题,我们要做如下的平安果。思路是把平安果分成几个部分,每个部分的曲线用 border-radius,再加上 transform, clip 之类的 CSS 特性来做。

图片描述

上面部分

HTML

<div class="apple">
    <div class="top-wrap">
        <div class="top left"></div>
        <div class="top right"></div>
    </div>
</div>

CSS

.apple {
    position: relative;
    width: 172px;
    height: 202px;
}

.top{
    position: absolute;
    top: 0;
    border-radius: 108px/128px;
    width: 108px;
    height: 100%;
    background-color: #e03a3e;
}

.top-wrap{
    position: absolute;
    top: 47px;
    height: 128px;
    width: 100%;
    overflow: hidden;
}

.top.left {
    left: 0;
}

.top.right {
    right: 0;
}

效果如下
图片描述

下面部分

HTML

<div class="apple">
    <div class="top-wrap">
        <div class="top left"></div>
        <div class="top right"></div>
    </div>
    <div class="bottom-wrap">
        <div class="bottom left"></div>
        <div class="bottom right"></div>
    </div>
</div>

CSS

.bottom-wrap {
    position: absolute;
    top: 98px;
    height: 104px;
    width: 100%;
    overflow: hidden;
}

.bottom {
    position: absolute;
    background-color: #e03a3e;
    border-radius: 22px 22px 64px 64px/106px 106px 106px 106px;
    height: 106px;
    top: 0;
    width: 64px;
}

.bottom.left {
    transform: rotate(-25deg);
    left: 12px;
}

.bottom.right {
    transform: rotate(25deg);
    right: 12px;
}

效果如下
图片描述

填充中间部分

HTML

<div class="apple">
    <div class="top-wrap">
        <div class="top left"></div>
        <div class="top right"></div>
    </div>
    <div class="bottom-wrap">
        <div class="bottom left"></div>
        <div class="bottom right"></div>
    </div>
    <div class="middle"></div>
</div>

CSS

.middle{
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    height: 145px;
    width: 70px;
    background-color: #e03a3e;
}

效果如下
图片描述

修饰一下头尾的曲线

HTML

<div class="apple">
    <div class="top-wrap">
        <div class="top left"></div>
        <div class="top right"></div>
    </div>
    <div class="bottom-wrap">
        <div class="bottom left"></div>
        <div class="bottom right"></div>
    </div>
    <div class="middle"></div>
    <div class="bottom-radius"></div>
    <div class="top-radius"></div>
</div>

CSS

.bottom-radius,
.top-radius {
    position: absolute;
    background-color: #e03a3e;
    left: 50%;
    transform: translateX(-50%);
}

.bottom-radius {
    position: absolute;
    border-radius: 50%;
    height: 22px;
    top: 192px;
    width: 48px;
    background-color: #fff;
}

.top-radius {
    top: -26px;
    border-radius: 20px;
    height: 80px;
    transform: translateX(-50%) rotate(-45deg) scale(0.9);
    width: 80px;
    background-color: #fff;
}

效果如下
图片描述

平安果柄

HTML

<div class="apple">
    <div class="handle"></div>
    <div class="top-wrap">
        <div class="top left"></div>
        <div class="top right"></div>
    </div>
    <div class="bottom-wrap">
        <div class="bottom left"></div>
        <div class="bottom right"></div>
    </div>
    <div class="middle"></div>
    <div class="bottom-radius"></div>
    <div class="top-radius"></div>
</div>

CSS

.handle {
    position: absolute;
    z-index: 100;
    left: 122px;
    top: -22px;
    transform: rotate(40deg);
    background-color: #62bb47;
}

.handle:before,
.handle:after {
    background-color: #62bb47;
    border-radius: 50%;
    content: "#";
    display: block;
    height: 90px;
    position: absolute;
    text-indent: -9999px;
    width: 90px;
}

.handle:before {
    clip: rect(0 13px 80px 0px);
}

.handle:after {
    clip: rect(14px 100px 76px 76px);
    left: -64px;
}

完成啦~
图片描述

完整代码


本文遵守创作共享CC BY-NC-SA 4.0协议
网络平台如需转载必须与本人联系确认。

點(diǎn)擊查看更多內(nèi)容
65人點(diǎn)贊

若覺(jué)得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶(hù)
支付方式
打開(kāi)微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專(zhuān)欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消