怎么把onmouseover放到css样式表中运行? 10
代码如下:<html><head><title>Background-colorChange</title><style>.menu2{width:100px;heigh...
代码如下:
<html>
<head>
<title>Background-color Change </title>
<style>
.menu2{width:100px;height:50px;border:solid 1px gray;cursor:pointer;background:blue;}
.menu3{
width:100px;
height:50px;
border:solid 1px gray;
cursor:pointer;
background-color: #FFF;
}
.menu{width:100px;height:50px;border:solid 1px gray;cursor:pointer;background:white;}
</style>
</head>
<body>
<div class="menu" onmouseover="this.className='menu2'" onmouseout="this.className='menu3'">你要的效果
</div>
</body>
</html> 展开
<html>
<head>
<title>Background-color Change </title>
<style>
.menu2{width:100px;height:50px;border:solid 1px gray;cursor:pointer;background:blue;}
.menu3{
width:100px;
height:50px;
border:solid 1px gray;
cursor:pointer;
background-color: #FFF;
}
.menu{width:100px;height:50px;border:solid 1px gray;cursor:pointer;background:white;}
</style>
</head>
<body>
<div class="menu" onmouseover="this.className='menu2'" onmouseout="this.className='menu3'">你要的效果
</div>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询