---
title: "DIV+CSS 百分比进度条"
author: "hou_jian_yong"
date: "2012-06-04T13:37:38Z"
tags: []
categories: ["Web前端"]
slug: "div-css"
draft: false
lastmod: "2012-06-04T13:39:00Z"
id: 1550328
url: "https://espace.iteye.com/blog/1550328"
---

```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>CSS Graph</title>
<style>
.graph {
float:left;
margin:0px;
background-color:#cecece;
position:relative;
width:100px;
padding:0
}

.graph .bar {
display:block;
position:relative;
background-image:url(images/bargraph.gif);
background-position:right center;
background-repeat:repeat-x;
border-right:#538e02 1px solid;
text-align:center;
color:#fff;
height:19px;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
line-height:1.9em
}

.graph .bar span {
position:absolute;
left:1em
}
</style>
</head>
<body>
<div class="graph"><strong class="bar" style="width:70%;">70%</strong></div>
</body>
</html>
```