<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>进度条案例</title>
<style type="textćs">
*{
padding: 0;
margin: 20px;
}
div{
position: relative;
width: 150px;
height: 10px;
border: 1px solid tomato;
border-radius: 5px;
transition: width 0.3s;
}
.d:hover{
width: 150px;
height: 10px;
}
.d{
position: absolute;
top: -20px;
left: -20px;
width: 100px;
height: 10px;
background: tomato;
}
.box{
width: 100px;
height: 100px;
background: orangered;
transform: translate(50% 0px);
}
<×yle>
</head>
<body>
<div>
<div class="d"></div>
</div><br><br>
<div class="box"></div>
</body>
<cml>