当前位置:阳诡子 > 建站 > 正文

CSS悬停DIV背景变色

时间:2020-08-23  来源:  作者:
<!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>divhover</title>
</head>
<style type="text/css">
body {
background: #fff;
font-family: "Lucida Grande", Helvetica, Arial, sans-serif;
font-size: 11px;
}
/* The style starts here */
#tabs
{padding:0;
margin:0 0 0 15px;
list-style:none;
}
#tabs li{
display:inline;
padding:0;
background:#f8f8f8;
float:left;
margin-right:35px;
position:relative;
}
#tabs li.one{
width:190px;
}
#tabs li.two{
width:240px;
}
#tabs li.three
{width:190px;
}
#tabs li a.outer-link{
background:#f8f8f8;
display:block;
width:100%;
position:relative;
}
#tabs table{
border-collapse:collapse;
margin:-1px;
}
#tabs li div{
border:1px solid #888;
padding:5px;
}
#tabs li a{
color:#000;
text-decoration:none;
}
#tabs li a.inner-link{
color:#c00;
text-decoration:none;
}
#tabs li a.inner-link:hover{
text-decoration:underline;
}
#tabs li.one:hover,#tabs li.one a.outer-link:hover{
background:#fef;
}
#tabs li.two:hover,#tabs li.two a.outer-link:hover{
background:#cff;
}
#tabs li.three:hover,#tabs li.three a.outer-link:hover{
background:#ffc;
}
</style>
<body>
<ul id="tabs">
<li class="one">
<!--[if lte IE 6]><a class="outer-link" href="nogo"><table><tr><td><![endif]-->
<div>
The award-winning Web browser just got better. It's free and easy to use. Join the millions of people worldwide enjoying a better Web experience.<br />
<a class="inner-link" href="http://www.mozilla.com/en-US/firefox/">Download Firefox - Free</a>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li class="two">
<!--[if lte IE 6]><a class="outer-link" href="nogo"><table><tr><td><![endif]-->
<div>
Try Speed Dial&#8482; in Opera's newest Web browser, Opera 9.20. It makes the fastest even faster. <br />
<a class="inner-link" href="http://www.opera.com/download/get.pl?id=&amp;thanks=true&amp;sub=true">Download Opera for Windows</a>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li class="three">
<!--[if lte IE 6]><a class="outer-link" href="nogo"><table><tr><td><![endif]-->
<div>
Upgrade with confidence. Get downloads for Internet Explorer 7, including recommended updates as they become available.<br />
<a class="inner-link" href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer 7 Download</a>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>
</body>
</html>
来顶一下
返回首页
返回首页
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
相关文章
CopyRight 2008-2022, 529600.Net, Inc.All Rights Reserved
粤ICP备2022094815号-1  网安备案粤公网安备 44178102001207号