简单的进度条以及百分比取整数

css:

style{
.progress {
 	height: 20px;
  	background: #696969;
        width: 200px
     }
.progress > span {
	position: relative;		
	margin: 0 -1px;
	min-width: 30px;
	eight: 18px;				
	text-align: right;
   }
.progress > span > span {
	 padding: 0 8px;
	 font-size: 11px;
	 color:white;
	 float: left;	
}
.progress .green {
	 background-color: #00CCFF;
	 float: left;
}
}

html:

<div class="progress">
<span class="green" style="width:${(list_cpjd.finish_num/list_cpjd.user_num)*100}%;">  //设置宽度百分比
<span style="line-height: 18px"><fmt:formatNumber type="number" value="${(list_cpjd.finish_num/list_cpjd.user_num)*100}" maxFractionDigits="0"/>%  //取整数百分比,防止出现除不尽的情况
</span>
</span>
</div>

猜你喜欢

转载自blog.csdn.net/qq_38880700/article/details/79363498