skip to content
Advertise here

A definition list bar chart

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%

CSS play Support


CSS play Recommend

Free, practical CSS menus, layouts, and examples

Follow CSS play

Facebook  Twitter  Facebook Fan Page



Just CSS | Designs for the future

Like the CSS Zen Garden?
Then why not visit Just CSS and see it you can design for the future.




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.



  • Each week the Creare Group produce video tutorials for SEO and tips and tricks for the web design industry.
  • We offer nothing but the highest quality SEO, Social Media Optimisation And PPC services to businesses in London

 

CSS play Testimonial

"The citroen.co.uk web site uses
CSS play code for the site drop down menus.
This code works seamlessly in IE 6 & 7, and is an excellent solution to the Creative requirements of the site."

Damon Clark - Brandwidth