Learn CSS, Selectors - The Universal Selector
(Page 2 of 4 )
CSS supports a selector called the universal selector (and it's supported by almost all the browsers), which you can use to apply certain styling properties to each and every element in the document. That's why it's called universal, because it applies the styling properties to all of the elements in the Web page. You need to understand inheritance and cascade to understand how to use the universal selector; I will discuss these concepts a little later in the series.
Let's look at an example of how to use the universal selector. Replace the above CSS code with the following, and reload the Web page.
*
{
font-size: .9em;
font-family: Arial, Tahoma;
color: blue;
}
As you have guessed, the asterisk symbol is the universal selector. Here we are saying that we want all of the elements in the referencing web page to have a font-size of 90 percent of the default font size, a font-family of Arial with an alternative font of Tahoma and blue text. Here's the resulting Web page.

Next: The Class Selector >>
More Style Sheets Articles
More By Michael Youssef