拼出自己的名字——背景定位属性

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>拼出自己名字</title>
    <style>
        span {
            display: inline-block;
        }
        
        .box1 {
            background: url(abcd.jpg) no-repeat -99px -144px;
             100px;
            height: 100px;
        }
        
        .box2 {
            background: url(abcd.jpg) no-repeat -5px -280px;
             100px;
            height: 100px;
        }
        
        .box3 {
            background: url(abcd.jpg) no-repeat -493px -280px;
             100px;
            height: 100px;
        }
    </style>
</head>

<body>
    <span class="box1">

    </span>
    <span class="box2">

    </span><span class="box3">

    </span>
</body>

</html>
原文地址:https://www.cnblogs.com/icemiaomiao3/p/14582154.html