css 实现进度条

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<style>
.box{
    width: 200px;
    height: 20px;
    background:#ccc;
    border-radius:10px;
    position:relative
    }
.clip{
    position: absolute;
    width: 100%;
    height: 100%;
    clip: rect(0px,100px,20px,0px); /* 第二个参数为进度值,当前进度为50%,100%对应200px */
    background: red;
    border-radius:10px;
    }
</style>
</head>
<body>
<div class='box'>
<span class='clip'></span>
</div>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/sea-stream/p/10538016.html