一张大图中包含很多小图,结合css的
"height", "width", "background-image","background-repeat","background-position"的组合进行背景定位。
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
a {
width: 67px;
height: 32px;
background: url(110.png) no-repeat left top;
display: block; /*转换*/
}
a:hover {
background-position: left bottom;
}
</style>
</head>
<body>
<a href="#"></a>
</body>
原文地址:https://www.cnblogs.com/allen2333/p/9004527.html
时间: 2024-10-09 05:49:24