The above bar charts do not reflect the usage on this site, which suprisingly is visited more by Gecko based browsers than IE6.
These charts are nothing more than a styled definition list with just classes defining each line.
The second chart has been added to rectify the problem that can happen in the first chart when values get closer to 100% (thanks to Chris Hunt for pointing this out).
Cascading Style Sheet – chart #1
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:1.5em;
border-bottom:3px solid #fff;
}
dd {
margin:0;
display:block;
width:400px;
height:2em;
background:#0a0;
border-bottom:1px solid #fff;
}
dd b {
float:right;
display:block;
margin-left:auto;
background:#cec;
height:2em;
line-height:2em;
text-align:right;
}
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%;}
Cascading Style Sheet – chart #2
#mk2 {
margin:20px 0 0 0;
padding:0;
width:401px;
height:auto;
background:#fc6 url(grid.gif) repeat-y left bottom;
position:relative;
}
#mk2 dt {
background:#fff;
text-align:center;
font-size:1.5em;
padding:2px 0;
}
#mk2 dd {
margin:0;
display:block;
width:100%;
height:20px;
background:#f80;
border-bottom:1px solid #000;
border-top:1px solid #fff;
}
* html #mk2 dd {
height:21px; he\ight:20px;
}
#mk2 dd b {
position:absolute;
text-align:left;
right:-111px;
display:block;
background:#fff;
padding-right:2px;
height:2em;
line-height:2em;
width:100px;
}
#mk2 dd.p670 {width:67%;}
#mk2 dd.p67 {width:6.7%;}
#mk2 dd.p14 {width:1.4%;}
#mk2 dd.p197 {width:19.7%;}
#mk2 dd.p26 {width:2.6%;}
#mk2 dd.p11 {width:1.1%;}
xhtml
<dl> <dt>Browser usage (%) - July 2005</dt> <dd class="p670"><b>IE.6 = 67% </b></dd> <dd class="p67"><b>IE.5 = 6.7% </b></dd> <dd class="p12"><b>Opera = 1.2% </b></dd> <dd class="p197"><b>Firefox = 19.7% </b></dd> <dd class="p26"><b>Mozilla = 2.6% </b></dd> <dd class="p08"><b>NN7 = 0.8% </b></dd> </dl>
Demo: http://www.cssplay.co.uk/menu/barchart.html
Source: http://www.cssplay.co.uk/menu/barchart.html

Related Listings:
No comments yet.
RSS feed for comments on this post. TrackBack URL