Type selectors

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
Please take two minutes to fill out our short survey.

O seletor de tipo CSS corresponde aos elementos pelo nome do nó. Em outras palavras, ele seleciona todos os elementos do tipo fornecido em um documento.

css
/* Todos os elementos <a> */
a {
  color: red;
}

Sintaxe

element { style properties }

Exemplos

CSS

css
span {
  background-color: skyblue;
}

HTML

html
<span>Here's a span with some text.</span>
<p>Here's a p with some text.</p>
<span>Here's a span with more text.</span>

Result

Especificações

Specification
Selectors Level 4
# type-selectors

Compatibilidade com navegadores