本文實例講述了CSS實現類似條狀統計表效果的方法。分享給大家供大家參考。具體實現方法如下:
復制代碼代碼如下:
<!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>
<title>用CSS設計類似條狀統計表效果</title>
<meta http-equiv="Content-Type" content="text/Html; charset=utf-8" />
<style>
dl {
margin:0;
padding:0 0 15px 0;
width:401px;
height:auto;
background:#fff url(bar.gif) bottom left no-repeat;
}
dt {
text-align:center;
font-size:12px;
border-bottom:3px solid #fff;
}
dd {
margin:0;
display:block;
width:400px;
height:2em;
background:#0a0;
border-bottom:1px solid #fff;
font-size:12px;
}
dd b {
float:right;
display:block;
margin-left:auto;
background:#cec;
height:2em;
line-height:2em;
text-align:right;
font-size:12px;
}
dd.p670 b {width:33%;}
dd.p67 b {width:93.3%;}
dd.p12 b {width:98.8%;}
dd.p197 b {width:80.3%;}
dd.p26 b {width:97.3%;}
dd.p08 b {width:99.2%;}
</style>
</head>
<body>
<dl>
<dt>主流浏覽器用戶數(%) - July 2009</dt>
<dd class="p670"><b>IE6 = 21% </b></dd>
<dd class="p67"><b>IE7 = 52% </b></dd>
<dd class="p12"><b>Opera = 3.2% </b></dd>
<dd class="p197"><b>Firefox = 16.7% </b></dd>
<dd class="p26"><b>Mozilla = 6.3% </b></dd>
<dd class="p08"><b>NN7 = 1.2% </b></dd>
</dl>
<div>http://www.jb51.Net/</div>
</body>
</Html>
希望本文所述對大家的CSS+div網頁設計有所幫助。