您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

网页进度条一种简单的实现方法

2024/3/22 3:44:12发布25次查看
一个很简单的进度条
用一个简单的css属性就能实现:cilp
clip:rect(top,right,bottom,left )
先写一个小程序来解释
<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); background: red; border-radius:10px; } </style> <p class='box'> <span class='clip'></span> </p>
显示效果:
给.clip加上position:absolute;width:100%;height:100%;相对于在box里加上一个一样宽高的盒子,背景为红色;
rect(top,right,bottom,left),相对于控制这个盒子显示的面积,通过改变距离right的值,使显示的面积变大
以上就是网页进度条一种简单的实现方法的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product