Skip to: content, navigation

by Tommy Olsson and Paul O’Brien

Element Type Selector (CSS selector)

Browser support full matrix
IE7+ FF1+ Saf1.3+ Op9.2+
Full Full Full Full
Spec
Version
CSS1

Example

Consider this example selector:

ul {
  ⋮ declarations
}

A type selector like the above ul matches all the elements within an HTML or XML document that are marked up as follows:

<ul> … </ul>

Try it yourself!View all demos

Description

While the universal selector matches any element, an element type selector matches elements with the corresponding element type name. Type selectors are case insensitive in HTML (including XHTML served as text/html), but are case sensitive in XML (including XHTML served as XML).

Compatibility

IE5.5Partial
6.0Partial
7.0Full
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Full
2.0Full
3.0Full
Opera9.2Full
9.5Full

Internet Explorer versions up to and including 6 don’t support the abbr element, and the type selector abbr is ignored by those browsers. However, Dean Edwards has produced a simple workaround: if the "html" namespace prefix is used in the selector html\:abbr, Internet Explorer 6 and earlier versions can be made to recognize the element and apply the declarations. In the following example, we group two element type selectors (see Selector Grouping)—one for IE6, and one for all other browsers that support the abbr element:

html\:abbr, abbr {
  cursor: help;
  font-style: italic;
}

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters