《2018年12月6日》【连续428天】
标题:过渡实例;
内容:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
div {
width: 183px;
height: 130px;
overflow: hidden;
}
div img {
width: 193px;
height: 130px;
transition: all .4s;
}
div:hover img {
margin-left: -10px;
}
</style>
</head>
<body>
<div>
<img src="images/1.jpg">
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
* {
margin: 0px;
padding: 0px;
}
li {
list-style: none;
}
.nav {
margin: 100px auto;
width: 20px;
}
.nav li {
width: 20px;
height: 20px;
margin: 3px 0;
background-color: red;
position: relative;
}
.nav div {
position: absolute;
right: 0;
top: 0;
height: 20px;
width: 0;
background-color: black;
transition: all .6s;
z-index: -1;
}
.nav li:hover div {
width: 100px;
}
</style>
</head>
<body>
<div class="nav">
<ul>
<li>
<div></div>
</li>
<li>
<div></div>
</li>
<li>
<div></div>
</li>
<li>
<div></div>
</li>
<li>
<div></div>
</li>
</ul>
</div>
</body>
</html>