购物进度条--过渡元素
<!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: 300px;
height: 50px;
border-radius: 25px;
border: 1px solid red;
}
.bar-in {
width: 50px;
height: 100%;
transition: width 1s ease 0s;
background-color: red;
border-radius: 25px 0 0 25px;
}
.bar:hover .bar-in {
width: 150px;
}
/* 他是bar加了padding,里面的条是矩形的 */
</style>
</head>
<body>
<div class="bar">
<div class="bar-in"></div>
</div>
</body>
</html>