CSS attr() Funzione
❮ Riferimento alle funzioni CSS
Esempio
L'esempio seguente inserisce il valore dell'attributo href tra parentesi dopo ogni collegamento:
a:after {
content: " (" attr(href) ")";
}
Definizione e utilizzo
La funzione attr() restituisce il valore di un attributo degli elementi selezionati.
Versione: | CSS2 |
---|
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente la funzione.
Function | |||||
---|---|---|---|---|---|
attr() | 2.0 | 8.0 | 1.0 | 3.1 | 9.0 |
Sintassi CSS
attr(attribute-name)
Value | Description |
---|---|
attribute-name | Required. The name of the attribute of the HTML element(s) |
❮ Riferimento alle funzioni CSS