给A标签加hover属性(加载时在默认为选中状态)
展开全部
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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">
*{ margin:0px; padding:0px;}
.g{ float:left; width:676px;}
.g a{ margin:0 5px;}
.g .g5 a{ background:#000;display:block; width:90px; height:213px; float:left;}
.g .g5 a:hover,.g .current a{ background:red; width:366px; height:213px;display:block;}
.g .g6 a{background:#000;display:block; width:90px; height:213px; float:left;}
.g .g6 a:hover{background:red; width:366px; height:213px;display:block;}
.g .g7 a{background:#000;display:block; width:90px; height:213px; float:left;}
.g .g7 a:hover{background:red; width:366px; height:213px;display:block;}
</style>
</head>
<body>
<div class="g">
<div class="g5 current"><a href="#">as</a></div>
<div class="g6"><a href="#">as</a></div>
<div class="g7"><a href="#">as</a></div>
</div>
</body>
</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">
*{ margin:0px; padding:0px;}
.g{ float:left; width:676px;}
.g a{ margin:0 5px;}
.g .g5 a{ background:#000;display:block; width:90px; height:213px; float:left;}
.g .g5 a:hover,.g .current a{ background:red; width:366px; height:213px;display:block;}
.g .g6 a{background:#000;display:block; width:90px; height:213px; float:left;}
.g .g6 a:hover{background:red; width:366px; height:213px;display:block;}
.g .g7 a{background:#000;display:block; width:90px; height:213px; float:left;}
.g .g7 a:hover{background:red; width:366px; height:213px;display:block;}
</style>
</head>
<body>
<div class="g">
<div class="g5 current"><a href="#">as</a></div>
<div class="g6"><a href="#">as</a></div>
<div class="g7"><a href="#">as</a></div>
</div>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询