CSS-Eigenschaft: text-decoration-style, Kategorien: Textdarstellung (allgemein), Text Decoration (CSS 3)
Stil von "text-decoration"
Steuert den Style der Linie, welche per "text-decoration" definiert ist.
Kurzbeschreibung | Werte | Standardwert | Kategorie | Hinweis |
---|---|---|---|---|
Stil von "text-decoration" |
| solid |
| Neu in CSS 3 |
Verwandte Eigenschaften aus der Kategorie: Textdarstellung (allgemein), Text Decoration (CSS 3):
- hyphens
- letter-spacing
- line-break
- line-height
- line-stacking
- line-stacking-ruby
- line-stacking-shift
- line-stacking-strategy
- marquee-direction
- marquee-play-count
- marquee-speed
- marquee-style
- overflow-style
- overflow-wrap
- tab-size
- text-align
- text-align-last
- text-decoration
- text-decoration-color
- text-decoration-line
- text-decoration-skip
- Aktuelle Seite: text-decoration-style
- text-emphasis
- text-emphasis-color
- text-emphasis-position
- text-emphasis-style
- text-height
- text-indent
- text-justify
- text-overflow
- text-shadow
- text-transform
- text-underline-position
- white-space
- word-break
- word-spacing
- word-wrap
Folgendes ist beim Einsatz von text-decoration-style zu beachten:
- text-decoration-style bestimmt den Stil der Linie, die per text-decoration
definiert ist. Dabei spielt es keine Rolle, ob der Wert underline oder einer der seit CSS3
neuen Parameter overline bzw. line-through gesetzt ist.
Eine Wert für text-decoration (CSS 2.1)
beziehungsweise
text-decoration-line
(CSS3) muss allerdings gesetzt sein, ohne diesen kommt es zu keiner Anzeige einer Linie unter, über oder durch den Text. - Neben den von border-style bekannten Werten solid, double, dotted und dashed steht ein neuer Parameter zur Verfügung: wavy. Dieser Wert definiert eine wellenförmige Linie.
- Der Browsersupport von text-decoration-style ist noch sehr mäßig, bis auf Firefox, und dieser nur mir Vendor-Präfix, wird diese CSS-Eigenschaft von noch keinem Browser unterstützt (November 2011).
![]() Firefox | ![]() Chrome | ![]() Internet Explorer | ![]() Safari | ![]() Opera |
|||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CSS3 |
|
|
|
|
|
Weiterführende Informationen zu text-decoration-style:
- W3C Spezifikation:
http://www.w3.org/TR/css-text-decor-3/#text-decoration-style
- letzte CSS-Eigenschaft (Acc-Key: ALT + SHIFT + z):
text-decoration-skip - nächste CSS-Eigenschaft (Acc-Key: ALT + SHIFT + w):
text-emphasis
Beispiele
HTML:
<h1 id="example-1">text-decoration-style</h1>
CSS:
h1 {
text-decoration: underline;
}
/* text-decoration muss definiert sein, damit text-decoration-style greifen kann. */
Beispiel Nr. 1 So sieht's aus:
text-decoration-style
HTML:
<h1 id="example-2">text-decoration-style</h1>
CSS:
#example-2 {
-moz-text-decoration-style: double;
-webkit-text-decoration-style: double;
-o-text-decoration-style: double;
-ms-text-decoration-style: double;
text-decoration-style: double;
color: red;
}
/* Doppelte Linie. Nur Firefox. */
Beispiel Nr. 2 So sieht's aus:
text-decoration-style
HTML:
<h1 id="example-3">text-decoration-style</h1>
CSS:
#example-3 {
-moz-text-decoration-style: dotted;
-webkit-text-decoration-style: dotted;
-o-text-decoration-style: dotted;
-ms-text-decoration-style: dotted;
text-decoration-style: dotted;
color: blue;
}
/* Gepunktete Linie. Nur Firefox. */
Beispiel Nr. 3 So sieht's aus:
text-decoration-style
HTML:
<h1 id="example-4">text-decoration-style</h1>
CSS:
#example-4 {
-moz-text-decoration-style: dashed;
-webkit-text-decoration-style: dashed;
-o-text-decoration-style: dashed;
-ms-text-decoration-style: dashed;
text-decoration-style: dashed;
color: green;
}
/* Gestrichelte Linie. Nur Firefox. */
Beispiel Nr. 4 So sieht's aus:
text-decoration-style
HTML:
<h1 id="example-5">text-decoration-style</h1>
CSS:
#example-5 {
-moz-text-decoration-style: wavy;
-webkit-text-decoration-style: wavy;
-o-text-decoration-style: wavy;
-ms-text-decoration-style: wavy;
text-decoration-style: wavy;
color: #00f000;
}
/* Wellenförmige Linie. Nur Firefox. */
Beispiel Nr. 5 So sieht's aus:
text-decoration-style
HTML:
<div id="testcase-vendor">
<h2 class="solid">solid</h2>
<h2 class="double">double</h2>
<h2 class="dotted">dotted</h2>
<h2 class="dashed">dashed</h2>
<h2 class="wavy">wavy</h2>
</div>
CSS:
/* Testcase Vendor-Präfixe: */
#testcase-vendor h2 {
color: #0000bb;
text-decoration: underline;
}
#testcase-vendor .solid {
-moz-text-decoration-style: solid;
-webkit-text-decoration-style: solid;
-o-text-decoration-style: solid;
-ms-text-decoration-style: solid;
}
#testcase-vendor .double {
-moz-text-decoration-style: double;
-webkit-text-decoration-style: double;
-o-text-decoration-style: double;
-ms-text-decoration-style: double;
}
#testcase-vendor .dotted {
-moz-text-decoration-style: dotted;
-webkit-text-decoration-style: dotted;
-o-text-decoration-style: dotted;
-ms-text-decoration-style: dotted;
}
#testcase-vendor .dashed {
-moz-text-decoration-style: dashed;
-webkit-text-decoration-style: dashed;
-o-text-decoration-style: dashed;
-ms-text-decoration-style: dashed;
}
#testcase-vendor .wavy {
-moz-text-decoration-style: wavy;
-webkit-text-decoration-style: wavy;
-o-text-decoration-style: wavy;
-ms-text-decoration-style: wavy;
}
Testbeispiel: Schreibweise mit
Vendor-Präfix
solid
double
dotted
dashed
wavy
HTML:
<div id="testcase-standard">
<h2 class="solid">solid</h2>
<h2 class="double">double</h2>
<h2 class="dotted">dotted</h2>
<h2 class="dashed">dashed</h2>
<h2 class="wavy">wavy</h2>
</div>
CSS:
/* Testcase Standardschreibweise: */
#testcase-standard h2 {
color: #990000;
text-decoration: underline;
}
#testcase-standard .solid {
decoration-style: solid;
}
#testcase-standard .double {
text-decoration-style: double;
}
#testcase-standard .dotted {
text-decoration-style: dotted;
}
#testcase-standard .dashed {
text-decoration-style: dashed;
}
#testcase-standard .wavy {
text-decoration-style: wavy;
}
Testbeispiel: Standardschreibweise
solid
double
dotted
dashed
wavy
Fehler melden
Diese Referenz ist ein Freizeitprojekt ohne aufwendiges Lektorat oder Vergleichbarem. Von daher lassen sich bei dem Umfang dieser Referenz trotzt größtmöglicher Sorgfalt Fehler nicht vermeiden.
Hilf, die Qualität dieser Seite zu verbessern! Sollte Dir ein Fehler auffallen, sei es in den Erklärungen, Beispielen oder den Informationen zum Browsersupport, seien es orthographische oder grammatikalische, sende eine kurze E-Mail an info@css-wiki.com. Auch Anregungen und Verbesserungsvorschläge sind jeder Zeit Willkommen. Jede E-Mail wird persönlich beantwortet!
Vielen Dank!