html背景图的显示

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>background</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            background: url('1.jpg') no-repeat scroll -10px -10px/100px 100px content-box padding-box yellow;

            /*拆分
                background-image:url(1.jpg);
                background-repeat:no-repeat;
                background-attachment:scroll;
                background-position:-10px -0px;
                background-size:100px 100px;
                background-origin:content-box;
                background-clip:padding-box; 从padding(不包括padding)往外裁剪
                background-color: yellow;
            */

            padding: 20px;
            border: 20px dashed red;
        }
    </style>
</head>
<body>
    <div>content</div>
</body>
</html>

演示地址

http://xhope.top/samples/html/background.html