我不知道我在做什么错,对我来说代码似乎是正确的,但我想这不是或否则它会工作。实际的精灵按钮没有显示在浏览器中,我可以点击看不见的按钮,但我无法看到它,我不知道如何解决它。需要帮助。无法解决CSS精灵问题
这里的CSS
@charset "UTF-8";
/* CSS Document */
a.button
{
height: 48px;
background-image: url("images/Home.png");
text-indent: -9999px;
display: inline-block;
}
#home
{
width: 186px;
background-position: 0px 0px;
}
#home:hover
{
background-position: 0px -40px;
}
#home:active
{
background-position: 0px -80px;
}
这里的HTML
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="css/main.css" rel="stylesheet" type="text/css" media="screen">
</head>
<body>
<a href="#" class="button" id="home">Home</a>
</body>
</html>
你有一个链接到这个? –
不,我没有链接 – Robert