Element Type Selector (CSS selector)
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>
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
| IE | 5.5 | Partial |
|---|---|---|
| 6.0 | Partial | |
| 7.0 | Full | |
| Firefox | 1.0 | Full |
| 1.5 | Full | |
| 2.0 | Full | |
| Safari | 1.3 | Full |
| 2.0 | Full | |
| 3.0 | Full | |
| Opera | 9.2 | Full |
| 9.5 | 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
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.

