偽元素如何實現鼠標移入時下劃線展開特效?
完整代碼
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>鼠標移入下劃線展開</title>
<style type="text/css">
#underline{
width: 200px;
height: 50px;
background: #ddd;
margin: 20px;
position: relative;
}
#underline:after{
content: "";
width: 0;
height: 5px;
background: blue;
position: absolute;
top: 100%;
left: 50%;
transition: all .8s;
}
#underline:hover:after{
left: 0%;
width: 100%;
}
</style>
</head>
<body>
<div id="underline"></div>
</body>
</html>
上一篇電腦上管理照片有何神器
下一篇安安靜靜許某怎么做到的