Il selettore di tipo CSS identifica gli elementi in base al nome del nodo. In altre parole, seleziona tutti gli elementi di un dato tipo entro il documento.
/* Tutti gli elemnti <a>. */
a {
color: red;
}
Sintassi
element { style properties }
Esempio
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>
Risultato
Specifiche
Specifica | Status | Commento |
---|---|---|
Selectors Level 4 The definition of 'Type (tag name) selector' in that specification. |
Working Draft | Nessun cambiamento |
Selectors Level 3 The definition of 'type selectors' in that specification. |
Recommendation | Nessun cambiamento |
CSS Level 2 (Revision 1) The definition of 'type selectors' in that specification. |
Recommendation | |
CSS Level 1 The definition of 'type selectors' in that specification. |
Recommendation | Definizione iniziale |
Compatibilità Browser
BCD tables only load in the browser