The Universal Selector

The universal selector, *, is very useful because it matches any element. It is useful for many things, particularly in user preferences for fonts or, for example, colors:

blockquote {  /* This matches the blockquote element */
  color: white;
  background: blue none;
  }

blockquote * { /* This matches any element inside blockquote */
  color: white;
  background: transparent none;
  }

/* declarations of "color" for any element that could be within
   blockquote, such as links, must be in this stylesheet too */

The universal selector is very useful if a user with a disability must enforce some preference for all elements, for example, large fonts. It is also useful when specifying colors.


Valid HTML 4.0!

(Up to User Stylesheets Guide, CSS, David Baron)

LDB, dbaron@dbaron.org, 1999-06-15