日期:2014-05-17 浏览次数:20637 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
.outer{
width:200px;
background:yellow;
}
.inner{
background-color:red;
display:none;
}
a:hover .inner{
display:block;<!--这里为什么鼠标划过不显示出来呢-->
}
</style>
</head>
<body>
<div class="outer">
<a>aaaaaaaaaaaa</a>
<div class="inner"><a href="#">这里想鼠标划过显示</a></div>
</div>
</body>
</html>
为什么没有用呢这样写???????????????
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style type="text/css">
body > div {
position:relative;
}
div > div {
display:none;
border:1px solid #ccc;
padding:10px;
}
a:hover+div {
display:block;
}
</style>
</head>
<body>
<div>
<a href="#">google chrome</a>
<div>hello world</div>
</div>
</body>
</html>