赢在职场-WEB全栈开发-1-4background讲解

<html>

    <head>

        <title>

            抬头

        </title>


        <meta charset="utf-8">

        <link href = "main.css" rel = "stylesheet">


        <style>

            .InternalStyle1

            {

                width:660px;

                height:660px;

                background:green center bottom no-repeat url("dragon.png");

                <!background:green url("dragon.png") no-repeat 220px 110px; 图片右移220px 下移110px>

                <!repeat 重复 no-repeat 不重复 repeat-x 横向重复 repeat-y 纵向重复>

                <!x left center right>

                <!y top center bottom><!以上top、right、bottom、left、center、repeat、no-repeat、repeat-x、repeat-y等都是针对其中的背景图片做操作>

            }

        </style>

        

        <style>

            .InternalStyle2

            {

                width:400px;

                height:660px;

                background-color: aquamarine;

                background-image: url("dragon.png");

                background-repeat: repeat-y;

                background-position: center;

            }

        </style>

        

        <style>

            #InternalStyle3

            {

                width:600px;

                height:1500px;

                background-color:bisque;

                background-image: url("dragon.png");

                background-repeat: repeat-y;

                background-position: left;

                background-attachment: fixed;/*fixed 不滚动、scroll 滚动、用来设置背景图片是否随页面滚动*/

            }

        </style>


    </head>

    <body>

        <div style = "width:300px;height:100px;background:red">

            inline style、行内样式

        </div>

        

        <div class = "InternalStyle1">

            Internal Style1、内部样式1</div>


        <div class = "InternalStyle2">

        </div>


        <div id = "InternalStyle3">

        </div>

        

        <div class = "ExternalStyle">

            External Style、外部样式

        </div>

    </body>

</html>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值