<!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>
.bar {
width: 150px;
height: 15px;
border: 1px solid red;
border-radius: 7px;
padding: 1px;
}
.bar_in {
width: 50%;
height: 100%;
background-color: red;
transition: all .6s;
}
.bar:hover .bar_in {
width: 100%;
}
</style>
</head>
<body>
<div class="bar">
<div class="bar_in"></div>
</div>
</body>
</html>
这是一个使用CSS实现的简单进度条案例。当鼠标悬停在进度条上时,内部填充部分会平滑过渡到完全填充,过渡时间为0.6秒。这个案例展示了CSS的动画效果和过渡属性的应用。
478

被折叠的 条评论
为什么被折叠?



