css一段过渡模块的代码
2019-07-30 本文已影响0人
nickNic
C765ECB5-17C6-428E-A2A7-B7D94334C712.png
屏幕快照 2019-07-30 上午10.08.14.png
好了上代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
*{
margin: 0px;
padding: 0px;
}
div{
background-color: yellow;
height: 100px;
width: 800px;
margin: 100px auto;
text-align: center;
line-height: 100px;
}
span{
height: 100px;
width: 100px;
border: 1px red solid;
display: block;
float: left;
box-sizing: border-box;
transition: width,0.8s;
}
div:hover span{
width: 70px;
}
div span:hover{
width: 310px;
}
</style>
</head>
<body>
<div>
<span>不</span>
<span>涨</span>
<span>工</span>
<span>资</span>
<span>就</span>
<span>跑</span>
<span>路</span>
<span>吧</span>
</div>
</body>
</html>