A definition list bar chart

Pre 2006

Chart #1

Browser usage (%) - July 2005
IE.6 = 67% 
IE.5 = 6.7% 
Opera = 1.2% 
Firefox = 19.7% 
Mozilla = 2.6% 
NN7 = 0.8% 

Chart #2

Browser usage (%) - July 2005
IE.6 = 67%
IE.5 = 6.7%
Opera = 1.4%
Firefox = 19.7%
Mozilla = 2.6%
NN7 = 1.1%

copyright © stu nicholls - CSS play

Information

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>

Copyright

You may use this method on your personal 'non-profit' web site without seeking my permission. A link back to CSSplay is always appreciated.

Commercial usage is also permitted without seeking approval, but I would ask that a donation is considered to support my work on CSSPlay.

If you are having problems integrating any of my demonstrations into your website then I now offer a service to fault find and correct any errors that you may have introduced. Please email me for more information.



Please Support CSS play

Please note that if your donation is for a demo/menu then you will need to email me with the url of the demo/menu after making the donation

For more CSS demonstrations I recommend that you visit the Dynamic Drive CSS Library.


Free, practical CSS menus, layouts, and examples

Follow CSS play


Facebook   Twitter   Facebook Fan Page