CSS/Selectors/type selector

From Web Education Community Group
< CSS‎ | Selectors
Jump to: navigation, search

Type selector

A type selector represents an instance of the element type in the document tree.

Syntax

elementname{ properties }

Example

[style.css]

 h1{
   color: #f00;
   font-size: 1.2em;
 }
 p{
   font-size: 0.9em;
 }

[index.html]

<body>
  <h1>Type selector example.</h1>
  <p>This is a paragraph.</p>
</body>

Css3 selectors type.png

The CSS defines the Type selector in 6.1. Type selector.