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.
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
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Type selector ( elementName ) | ||||||||||||
Namespaces ( ns|elementName ) |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.