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

<!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;
            width: 100px;
            height: 100px;
        }
        
        .box2 {
            background: url(abcd.jpg) no-repeat -5px -280px;
            width: 100px;
            height: 100px;
        }
        
        .box3 {
            background: url(abcd.jpg) no-repeat -493px -280px;
            width: 100px;
            height: 100px;
        }
    </style>
</head>

<body>
    <span class="box1">

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

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

    </span>
</body>

</html>
posted @ 2021-03-26 14:25  ice猫猫3  阅读(94)  评论(0编辑  收藏  举报