css:
<style type="text/css">
.tou{
margin: 3rem 19rem;
}
.tou img {
width: 17%;
border: 1px solid red;
}
.tou1 img {
width: 17%;
border: 1px solid red;
}
</style>
</head>
html:
<body>
<div class="tou">
<img src="img/dh1.png"id="tutu" />
js:
<script type="text/javascript">
var img = document.getElementById('tutu');
img.onmouseover = function(){
img.src="img/dh11.png";
img.onmouseout = function(){
img.src="img/dh1.png";
};
};
</script>
<img src="img/dh2.png"id="tutu1" />
<script type="text/javascript">
var img1 = document.getElementById('tutu1');
img1.onmouseover = function(){
img1.src="img/dh22.png";
img1.onmouseout = function(){
img1.src="img/dh2.png";
};
};
</script>
</div>
</body>
今天就这样吧!