07. 背景图片距离

背景图片距离

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        #box{
            width: 100px;
            height: 200px;
            background: pink;
            padding: 100px;
            border: 80px solid blue;
            background-image: url("img/1.png");
            background-repeat: no-repeat;
            background-origin: content-box;
            background-position: -50px 0;
        }

        /*答案:130px*/
    </style>
</head>
<body>
<div id="box"></div>
</body>
</html>

  

posted @ 2019-03-01 17:30  Lolita_web  阅读(300)  评论(0编辑  收藏  举报