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.
/* Todos os elementos <a> */
a {
color: red;
}
Sintaxe
element { style properties }
Exemplos
CSS
span {
background-color: skyblue;
}
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
Especificação | Status | Comment |
---|---|---|
Selectors Level 4 The definition of 'Type (tag name) selector' in that specification. |
Rascunho atual | Sem mudanças |
Selectors Level 3 The definition of 'type selectors' in that specification. |
Recomendação | Sem mudanças |
CSS Level 2 (Revision 1) The definition of 'type selectors' in that specification. |
Recomendação | |
CSS Level 1 The definition of 'type selectors' in that specification. |
Recomendação | Definição Inicial |
Compatibilidade do navegador
BCD tables only load in the browser