CSS sprites 雪碧图使用

<style type="text/css">
    div{
        display: inline-block;
        width: 40px;
        height: 40px;
        background:url(./sprites.png);
        margin-bottom: 10px;
    }
    .icon2{
        background-position: -70px 0;
    }
    .icon3{
        background-position: -70px -30px;
    }
    .icon4{
        background-position: 0 -80px;
    }
</style>


<body>
    <div class="icon1"></div>
    <div class="icon2"></div>
    <div class="icon3"></div>
    <div class="icon4"></div>
</body>
<style type="text/css">
    div{
        display: inline-block;
        width: 40px;
        height: 40px;
        background:url(./sprites.png);
        margin-bottom: 10px;
    }
    .icon2{
        background-position: -70px 0;
    }
    .icon3{
        background-position: -70px -30px;
    }
    .icon4{
        background-position: 0 -80px;
    }
</style>


<body>
    <div class="icon1"></div>
    <div class="icon2"></div>
    <div class="icon3"></div>
    <div class="icon4"></div>
</body>

CSS sprites 雪碧图使用

上一篇:hadoop web console配置基于用户名访问


下一篇:Kubernetes 相关梳理