Use Cascading Style Sheets Selectors
By Nicholas Chase2004-06-18
Type selectors
Perhaps the most commonly used selector is the type selector, though most people think of it as a tag name or element selector. This selector chooses content based on the name of the element. For example, the following code in Listing 3 changes the size of any text within a table data (td) element, as shown in Figure 3:
Listing 3. Type selectors
...
<style type="text/css">
* { font-family: Verdana }
td { font-size: 10pt }
</style>
...
This style applies to any text within a table data element, no matter where it is in the hierarchy of the page.
Figure 3. Using a type selector
Tutorial Pages:
» The basic page and the universal selector
» Type selectors
» Class selectors
» ID selectors
» Family relationships: descendants, children, and siblings
» Pseudo-classes and pseudo-elements
» Summary
First published by IBM developerWorks
