Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
CSS Reference
Selectors
 Universal (*) Selector

  Switch on low bandwidth view
Universal (*) Selector
Matches any element type.

Syntax

HTML* { sRules }
ScriptingN/A

Possible Values

sRulesString that specifies one or more Cascading Style Sheets (CSS) attribute/value pairs.

Remarks

The universal selector matches every element in the document tree. If the universal selector is not the only component of a simple selector, the "*" may be omitted. For example:

  • *.myclass and .myclass are equivalent.
  • *#myid and #myid are equivalent.
  • *:hover and :hover are equivalent.

Example

The following style rule draws a thin orange border around every element on the page.

<style>
    * { border: 1px solid orange; }
</style>

Standards Information

This selector is defined in CSS, Level 2 (CSS2).

See Also

Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker