zoukankan      html  css  js  c++  java
  • css绘制进度条,持续转动的进度条

    //只有 progress pregress-par bar,进度条不会转,
    //增加 active 这个类,进度条会转,

    //html结构

    <div class='progress active'>
            <div class='progress-par bar' style='80%;'></div>
    </div>    
    

    //css

    .progress {
    	 100%;
    	height: 8px;
    	background-color: #e8e8e8;
    	border-radius: 6px;
    	margin-top: 8px;
    	overflow: hidden;
    }
    .progress-par {
    	background-color: #fb4748;
    	 75%;
    	position: relative;
    	height: 8px;
    	border-radius: 6px;
    	-webkit-transition: 0.4s linear;
    	-moz-transition: 0.4s linear;
    	-o-transition: 0.4s linear;
    	transition: 0.4s linear;
    	-webkit-transition-property: width, background-color;
    	-moz-transition-property: width, background-color;
    	-o-transition-property: width, background-color;
    	transition-property: width, background-color;
    }
    .progress .bar {
    	float: left;
    	 0;
    	height: 100%;
    	font-size: 12px;
    	color: #ffffff;
    	text-align: center;
    }
    .progress .bar {
    	background-color: #e83030;
    	background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0.25, #fb4748), color-stop(0.25, transparent), color-stop(0.5, transparent),
    color-stop(0.5, #fb4748), color-stop(0.75, #fb4748), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(135deg, #fb4748 25%, transparent 25%, transparent 50%, #fb4748 50%, #fb4748 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(135deg, #fb4748 25%, transparent 25%, transparent 50%, #fb4748 50%, #fb4748 75%, transparent 75%, transparent); background-image: -o-linear-gradient(135deg, #fb4748 25%, transparent 25%, transparent 50%, #fb4748 50%, #fb4748 75%, transparent 75%, transparent); background-image: linear-gradient(135deg, #fb4748 25%, transparent 25%, transparent 50%, #fb4748 50%, #fb4748 75%, transparent 75%, transparent); -webkit-background-size: 10px 10px; -moz-background-size: 10px 10px; -o-background-size: 10px 10px; background-size: 10px 10px; } .progress.active .bar { -webkit-animation: progress-bar 2s linear infinite; -moz-animation: progress-bar 2s linear infinite; -ms-animation: progress-bar 2s linear infinite; -o-animation: progress-bar 2s linear infinite; animation: progress-bar 2s linear infinite; } @keyframes progress-bar { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress-par:before, .progress-par:after { content: ''; position: absolute; top: 0; left: 0; right: 0; } .progress-par:after { z-index: 2; bottom: 0; border-radius: 6px; }

      

     

  • 相关阅读:
    【重温设计模式】之005单例模式
    【重温设计模式】之004抽象工厂模式
    【重温设计模式】之003工厂方法模式
    【重温设计模式】之002简单工厂模式
    【重温设计模式】之001概述
    【工具】之003-Windows下常用工具
    【工具】之002-Mac下常用工具
    【工具】之001-CentOS7 最小化安装配置
    做人要精致,做事要靠谱
    Vue+Vue-router微信分享功能
  • 原文地址:https://www.cnblogs.com/xiaosuibu/p/6742715.html
Copyright © 2011-2022 走看看