Selectors

Introduction

Style attributes are attached to elements with an XML or HTML document. A style may be applied to all html tags of a given name. A style selector is a means for specifying which html element or elements, a given style is to be applied to.

Element Name

An element may be selected by name.

Example

The following is the code.

h1 { color: blue; }

Multiple elements may be selected by name. The element names are separated by commas.

Example

The following is the code.

h1, h2 { color: blue; }

All elements may be selected.

Example

The following is the code.

* { color: red; }