.cssnav {
position:relative;
font-family: arial, helvetica, sans-serif;
background-image: url(img/twitter.jpg)no- repeat center center;
background-repeat: no-repeat;
white-space: nowrap;
display: block;
width: 211px;
height: 44px;
margin: 0;
padding: 0;
}
.cssnav a {
display: block;
color: #000000;
font-size: 11px;
width: 211px;
height: 44px;
display: block;
float: left;
color: black;
text-decoration: none;
}
.cssnav img {width: 211px; height: 44px; border: 0; }
* html a:hover {visibility:visible}
.cssnav a:hover img{visibility:hidden}
.cssnav span {
position: absolute;
left: 30px;
top: 15px;
margin: 0px;
padding: 0px;
cursor: pointer;
width: 149px;
height: 14px;
text-align: center;
}
/* END OF NAVIGATION */
}
<html>
<head>
<title>The history of aeronautics</title>
<meta charset="utf-8" />
<meta name="description" content="A parallax scrolling experiment using jQuery" />
<link rel="stylesheet" media="all" href="css/test.css" />
</head>
<body>
<!--MAIN NAVIGATION START-->
<div class="cssnav"><a href="http://www.search-this.com/" title="Search Engine Submission"><img src="img/twitter.png" alt="Search Engine Submission" /><span>Search
Engine Submission</span></a></div>
<div class="cssnav"><a href="http://www.search-this.com/website-design/" title="Website Design"><img src="img/twitter.jpg" alt="Website Design" /><span>Website
Design</span></a></div>
</body>
</html>
我已经包含了我的 CSS 和 HTML。我已经有一段时间试图弄清楚它为什么不起作用......我正在使用这里的三连胜翻转按钮代码:http ://www.webcredible.co.uk/user-friendly-resources/css /rollover-buttons.shtml
当我将代码放在我的 HTML 区域时它可以工作,但当我把它放在 CSS 中时它不起作用