CSS teksversiering Eiendom
Voorbeeld
Stel verskillende teksversierings vir <h1>-, <h2>- en <h3>-elemente:
h1 {
text-decoration: overline;
}
h2 {
text-decoration: line-through;
}
h3 {
text-decoration: underline;
}
h4 {
text-decoration: underline
overline;
}
Meer "Probeer dit self" voorbeelde hieronder.
Definisie en gebruik
Die text-decoration
eiendom spesifiseer die versiering wat by teks gevoeg word, en is 'n snelskrif-eienskap vir:
- teks-versiering-lyn (vereis)
- teks-versiering-kleur
- teks-versiering-styl
Standaard waarde: | geen huidige kleur solied nie |
---|---|
Geërf: | geen |
Animateerbaar: | nee, sien individuele eiendomme . Lees oor animeerbaar |
Weergawe: | CSS1, hernu in CSS3 |
JavaScript-sintaksis: | voorwerp .style.textDecoration="onderstreep" |
Blaaierondersteuning
Die nommers in die tabel spesifiseer die eerste blaaierweergawe wat die eiendom ten volle ondersteun.
Property | |||||
---|---|---|---|---|---|
text-decoration | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
CSS-sintaksis
text-decoration: text-decoration-line text-decoration-color
text-decoration-style|initial|inherit;
Eiendomswaardes
Value | Description |
---|---|
text-decoration-line | Sets the kind of text decoration to use (like underline, overline, line-through) |
text-decoration-color | Sets the color of the text decoration |
text-decoration-style | Sets the style of the text decoration (like solid, wavy, dotted, dashed, double) |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Meer voorbeelde
Voorbeeld
Voeg meer teksversiering by:
h1 {
text-decoration: underline overline dotted red;
}
h2 {
text-decoration: underline overline wavy
blue;
}
Verwante bladsye
CSS-tutoriaal: CSS-teks
HTML DOM verwysing: textDecoration eiendom