演示代码:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style type="text/css">
            div{
                width: 500px;height: 400px;
                background-color: #00ff00;
                background-image: url(bj.jpg);
                background-repeat: no-repeat;
                /* background-position: right bottom; */
                /* background-position: 50px 100px; */
                background-position: 100% 100%; /* 右下角 */
            }
        </style>
    </head>
    <body>
        <!-- 
        背景定位:
        background-position: x y; 水平,垂直
            1,方向定位:top上,bottom下,left左,right右,center中
            2,当设置一个值,另一个值就是center
            3,尺寸单位,参考位置元素左上角和背景图片左上角,设置一个值,这个值一定是水平位置
            4,百分比单位:0% 0%左上角;100% 100%右下角
         -->
        <div></div>
    </body>
</html>
打开支付宝首页搜“559920739”领红包,领到大红包的小伙伴赶紧使用哦! (如果你觉得本文不错,请扫描下面二维码随意打赏哦)
最后修改:2020 年 10 月 01 日
如果觉得我的文章对你有用,请随意赞赏