1. 程式人生 > >雪碧圖----gwc.css/gwc.html

雪碧圖----gwc.css/gwc.html

gwc.html

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>gwc</title>
	<link href='gwc.css' rel='stylesheet' type="text/css">
</head>
<body>
	<a href="#" class="btn"></a>
	
</body>
</html>

gwc.css

.btn:link{
	display: block;
	width:40px; 
	height:30px;
	background-image: url(img/1.png);
	background-repeat: no-repeat;
	background-position:-11px -341px;
}
.btn:hover{
	background-position:-57px -341px;
}
.btn:active{
	background-position:-129px -341px;
}