background-clip代码检查

background-clip代码检查

background-clip ...{ : : : : }
        {
            : : }
        ...{ : : :() : :() : :  }
        .:.:.:{
            : }
         ..{
            :  }
        ..{
            :  }
        ..{
            :  }
    border-boxpadding-boxcontent-box


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
imooc_慕慕 2022-09-28 09:41:40

同学你好,代码没有复制成功重新粘贴一下,祝学习愉快~

  • 提问者 永无止境内卷 #1

    <!DOCTYPE html>

    <html>

    <head>

        <meta charset="UTF-8">

        <title>background-clip</title>

        <style type="text/css">

            .border,.padding,.content{/*给最外层的div设置样式*/

                width:300px;

                height:300px;

                float:left;

                margin-left:50px;

            }

            a{

                text-decoration:none;

                font-size:30px;

            }

            .div1,.div2,.div3{/*放置背景图片的div样式*/

                width:220px;

                height:200px;

                border:10px solid rgba(0,255,0,0.3);

                padding:50px;

                background-image:url("http://img1.sycdn.imooc.com/climg//582c316e0001fd6507000210.jpg");

                margin-top:50px;

                display: none;

            }

            .border:hover div,.padding:hover div,.content:hover div{

                display:block;

            }

            /*补充代码*/

            .border .div1{

                background-clip: border-box;

            }

            .padding .div2{

                background-clip: padding-box;

            }

            .content .div3{

                background-clip: content-box;

            }

        </style>

    </head>

    <body>

    <div class="border">

        <a href="">border-box</a>

        <div class="div1"></div>

    </div>

    <div class="padding">

        <a href="">padding-box</a>

        <div class="div2"></div>

    </div>

    <div class="content">

        <a href="">content-box</a>

        <div class="div3"></div>

    </div>

    </body>

    </html>


    2022-09-28 12:29:21
  • imooc_慕慕 回复 提问者 永无止境内卷 #2

    同学你好,代码效果正确,很棒,祝学习愉快~

    2022-09-28 13:24:22
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师