init
This commit is contained in:
47
Html-Css/17-切换图片.html
Normal file
47
Html-Css/17-切换图片.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width-device-width,initial-scale=1.0">
|
||||
<title>切换图片</title>
|
||||
|
||||
<style>
|
||||
#img1 , #img2 {
|
||||
width: 200px;
|
||||
height: 300px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#app {
|
||||
background-color: lightblue;
|
||||
width: 200px;
|
||||
height: 300px;
|
||||
}
|
||||
#img2 {
|
||||
display: none;
|
||||
}
|
||||
#app:hover #img1 {
|
||||
display: none;
|
||||
}
|
||||
#app:hover #img2 {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="app">
|
||||
<img id="img1" src="https://tse2-mm.cn.bing.net/th/id/OIP-C.C38tPmdN8_amlKOTvKp45AHaNK?w=182&h=324&c=7&r=0&o=5&dpr=1.25&pid=1.7" alt="">
|
||||
<img id="img2" src="https://tse1-mm.cn.bing.net/th/id/OIP-C.Ca5vPlfNKm2z_DCvMe4QqwHaLi?w=182&h=284&c=7&r=0&o=5&dpr=1.25&pid=1.7" alt="">
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user