码迷,mamicode.com
首页 > 其他好文 > 详细

精灵图的使用方法

时间:2018-08-05 13:09:51      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:css   span   position   tle   body   height   type   over   set   

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        div {
            width: 25px;
            height: 25px;
            background: url("images/taobao.png");
            background-position: 0px 0px;
        }
        div:hover {
            background-position: 0px -89px;
        }

        /*如果使用精灵图:坐标:只有0或者负数*/
    </style>
</head>
<body>
    <div></div>
</body>
</html>

 

精灵图的使用方法

标签:css   span   position   tle   body   height   type   over   set   

原文地址:https://www.cnblogs.com/DZzzz/p/9424999.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!