[thelist] CSS: Why does this work?

Tanner Burson tanner at younet.okstate.edu
Tue Apr 6 11:13:43 CDT 2004

*This message was transferred with a trial version of CommuniGate(tm) Pro*
Good morning, afternoon, evening,

  <style type="text/css">
   * { font: 1em serif; }
   .a { position: absolute; z-index: 2;  top: 10; left: 10; padding: 10px;}
   .b { z-index: 1;  top: 0; left: 0; width: 100%; height: 100%;  padding:
0px; margin: 0px; align:center;}

  Then down in the code...

  <div class="test a">
	This is a test.

  works the same as...

  <div class="a">
	This is a test.

  Why does the div work when you enter either "test a" or just "a" in the
class field? As a random test, "cow a" works too.



It works because the class tag can take multiple classes separated by
spaces.  So class="test a" is actually saying inherit the properties of both
the "test" and the "a" classes.

Tanner Burson

More information about the thelist mailing list