• 利用css样式background-size做一个简单的进度条


    10%的进度

    10%

    代码

    <div class="progress-bar"
        style="200px; height:20px; background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAIAAABY/YLgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBhXY2BYdIWJgYGBPMzAAABdwAGV/9CqNwAAAABJRU5ErkJggg=='); background-repeat-x: no-repeat; background-repeat-y: no-repeat;
        background-size: 10%;
        border: #00a2d4 solid 1px;">
        10%
    </div>
    

    50%的进度

    50%

    代码

    <div class="progress-bar"
        style="200px; height:20px; background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAIAAABY/YLgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBhXY2BYdIWJgYGBPMzAAABdwAGV/9CqNwAAAABJRU5ErkJggg=='); background-repeat-x: no-repeat; background-repeat-y: no-repeat;
        background-size: 50%;
        border: #00a2d4 solid 1px;">
        50%
    </div>
    

    100%的进度

    100%

    代码

    <div class="progress-bar"
        style="200px; height:20px; background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAIAAABY/YLgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBhXY2BYdIWJgYGBPMzAAABdwAGV/9CqNwAAAABJRU5ErkJggg=='); background-repeat-x: no-repeat; background-repeat-y: no-repeat; 
        background-size: 101%;
        border: #00a2d4 solid 1px;">
        100%
    </div>
    

    这里要注意下,size要设置为101%才能填满,有兴趣的可以研究下,想必跟盒子模型有关,有答案的希望不吝赐教。

  • 相关阅读:
    【转】java正则表达式
    NDK学习笔记-使用现有so动态库
    NDK学习笔记-增量更新
    NDK学习笔记-增量更新
    NDK学习笔记-文件的拆分与合并
    NDK学习笔记-文件的拆分与合并
    NDK学习笔记-NDK开发流程
    NDK学习笔记-NDK开发流程
    NDK学习笔记-JNI的引用
    NDK学习笔记-JNI的引用
  • 原文地址:https://www.cnblogs.com/so-easy/p/12592139.html
Copyright © 2020-2023  润新知