Element Type Selector (CSS selector)

Spec
Version
CSS1
Browser support (more…)
IE7+ FF1+ SA1.3+ OP9.2+ CH2+
Full Full Full Full Full

Syntax

E {
declaration block
}

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).

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>

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Partial Partial Full Full Full Full Full Full Full Full Full Full Full Full Full Full Full

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

Related Products