text-decoration-style

  • Revision slug: CSS/text-decoration-style
  • Revision title: text-decoration-style
  • Revision id: 359783
  • Created:
  • Creator: mkato
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef }} {{ SeeCompatTable }}

Summary

The text-decoration-style CSS property defines the style of the lines specified by {{ cssxref("text-decoration-line") }}. The style applies to all lines, there is no way to define different style for each of the line defined by text-decoration-line.

If the specified decoration has a specific semantic meaning, like a line-through line meaning that some text has been deleted, authors are encouraged to denote this meaning using an HTML tag, like {{ HTMLElement("del") }} or {{ HTMLElement("s") }}. As browsers can disabled styling in some cases, the semantic meaning won't disappear in such a situation.

  • {{ Xref_cssinitial }} {{cssinitial("text-decoration-style")}}
  • Applies to all elements
  • {{ Xref_cssinherited }} no
  • Media {{ Xref_cssvisual }}
  • {{ Xref_csscomputed }} the value as specified via the syntax

Syntax

Formal syntax: {{csssyntax("text-decoration-style")}}
text-decoration-style: solid
text-decoration-style: double
text-decoration-style: dotted
text-decoration-style: dashed
text-decoration-style: wavy

text-decoration-style: inherit

Values

solid double dotted dashed wavy
Is one of the following keywords :
Keyword Description Live example Comment
solid Draws a single line Lorem ipsum  
double Draws a double line Lorem ipsum  
dotted Draws a dotted line Lorem ipsum  
dashed Draws a dashed line Lorem ipsum  
wavy Draws a wavy line Lorem ipsum  
-moz-none{{ non-standard_inline }} Do not draw a line Lorem ipsum Do not use : use {{ cssxref("text-decoration-line") }}: none instead
inherit
Is a keyword indicating to reuse the value calculated on the parent element.

Examples

.example { 
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: red;
}

This is how it looks.

Specifications

Specification Status Comment
{{ SpecName('CSS3 Text-decoration', '#text-decoration-style', 'text-decoration-style') }} {{ Spec2('CSS3 Text-decoration') }}  

Browser compatibility

{{ CompatibilityTable }}

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support {{ CompatGeckoDesktop("6.0") }}{{ property_prefix("-moz") }} {{ unimplemented_inline_webkit("90958") }} {{ CompatNo }} {{ CompatNo }} {{ unimplemented_inline_webkit("90958") }}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ unimplemented_inline_webkit("90958") }} {{ unimplemented_inline_webkit("90958") }} {{ CompatGeckoMobile("6.0") }}{{ property_prefix("-moz") }} {{ CompatNo }} {{ CompatNo }} {{ unimplemented_inline_webkit("90958") }}

See also

  • {{ CSS_Reference:Text }}

Revision Source

<div>
  {{ CSSRef }} {{ SeeCompatTable }}</div>
<h2 id="Summary">Summary</h2>
<p>The <code>text-decoration-style</code> CSS property defines the style of the lines specified by {{ cssxref("text-decoration-line") }}. The style applies to all lines, there is no way to define different style for each of the line defined by <code>text-decoration-line</code>.</p>
<p>If the specified decoration has a specific semantic meaning, like a line-through line meaning that some text has been deleted, authors are encouraged to denote this meaning using an HTML tag, like {{ HTMLElement("del") }} or {{ HTMLElement("s") }}. As browsers can disabled styling in some cases, the semantic meaning won't disappear in such a situation.</p>
<ul class="cssprop">
  <li><dfn>{{ Xref_cssinitial }}</dfn> {{cssinitial("text-decoration-style")}}</li>
  <li><dfn>Applies to</dfn> all elements</li>
  <li><dfn>{{ Xref_cssinherited }}</dfn> no</li>
  <li><dfn>Media</dfn> {{ Xref_cssvisual }}</li>
  <li><dfn>{{ Xref_csscomputed }}</dfn> the value as specified via the syntax</li>
</ul>
<h2 id="Syntax">Syntax</h2>
<pre class="twopartsyntaxbox">
<a href="/en-US/docs/CSS/Value_definition_syntax" title="CSS/Value_definition_syntax">Formal syntax</a>: {{csssyntax("text-decoration-style")}}
</pre>
<pre>
text-decoration-style: solid
text-decoration-style: double
text-decoration-style: dotted
text-decoration-style: dashed
text-decoration-style: wavy

text-decoration-style: inherit
</pre>
<h3 id="Values">Values</h3>
<dl>
  <dt>
    <code>solid double dotted dashed wavy</code></dt>
  <dd>
    Is one of the following keywords :
    <table class="standard-table">
      <thead>
        <tr>
          <th scope="col">Keyword</th>
          <th scope="col">Description</th>
          <th scope="col">Live example</th>
          <th scope="col">Comment</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><code>solid</code></td>
          <td>Draws a single line</td>
          <td><span style="-moz-text-decoration-style:solid;-moz-text-decoration-line:line-through;text-decoration-line:line-through;">Lorem</span> <span style="-moz-text-decoration-style:solid;-moz-text-decoration-line:underline;text-decoration-line:underline;">ipsum</span></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><code>double</code></td>
          <td>Draws a double line</td>
          <td><span style="-moz-text-decoration-style:double;-moz-text-decoration-line:line-through;text-decoration-line:line-through;">Lorem</span> <span style="-moz-text-decoration-style:double;-moz-text-decoration-line:underline;text-decoration-line:underline;">ipsum</span></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><code>dotted</code></td>
          <td>Draws a dotted line</td>
          <td><span style="-moz-text-decoration-style:dotted;-moz-text-decoration-line:line-through;text-decoration-line:line-through;">Lorem</span> <span style="-moz-text-decoration-style:dotted;-moz-text-decoration-line:underline;text-decoration-line:underline;">ipsum</span></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><code>dashed</code></td>
          <td>Draws a dashed line</td>
          <td><span style="-moz-text-decoration-style:dashed;-moz-text-decoration-line:line-through;text-decoration-line:line-through;">Lorem</span> <span style="-moz-text-decoration-style:dashed;-moz-text-decoration-line:underline;text-decoration-line:underline;">ipsum</span></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><code>wavy</code></td>
          <td>Draws a wavy line</td>
          <td><span style="-moz-text-decoration-style:wavy;-moz-text-decoration-line:line-through;text-decoration-line:line-through;">Lorem</span> <span style="-moz-text-decoration-style:wavy;-moz-text-decoration-line:underline;text-decoration-line:underline;">ipsum</span></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><code>-moz-none</code>{{ non-standard_inline }}<code> </code></td>
          <td>Do not draw a line</td>
          <td><span style="-moz-text-decoration-style:-moz-none;-moz-text-decoration-line:line-through;text-decoration-line:line-through;">Lorem</span> <span style="-moz-text-decoration-style:-moz-none;-moz-text-decoration-line:underline;text-decoration-line:underline;">ipsum</span></td>
          <td><strong>Do not use</strong><strong> :</strong> use {{ cssxref("text-decoration-line") }}<code>: none</code> instead</td>
        </tr>
      </tbody>
    </table>
  </dd>
  <dt>
    <code>inherit</code></dt>
  <dd>
    Is a keyword indicating to reuse the value calculated on the parent element.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre class="brush: css; highlight:[3]">
.example { 
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: red;
}
</pre>
<p><span style="-moz-text-decoration-line: underline; -moz-text-decoration-style: wavy; -moz-text-decoration-color: red">This is how it looks.</span></p>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('CSS3 Text-decoration', '#text-decoration-style', 'text-decoration-style') }}</td>
      <td>{{ Spec2('CSS3 Text-decoration') }}</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Firefox (Gecko)</th>
        <th>Chrome</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatGeckoDesktop("6.0") }}{{ property_prefix("-moz") }}</td>
        <td>{{ unimplemented_inline_webkit("90958") }}</td>
        <td>{{ CompatNo }}</td>
        <td>{{ CompatNo }}</td>
        <td>{{ unimplemented_inline_webkit("90958") }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Chrome for Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ unimplemented_inline_webkit("90958") }}</td>
        <td>{{ unimplemented_inline_webkit("90958") }}</td>
        <td>{{ CompatGeckoMobile("6.0") }}{{ property_prefix("-moz") }}</td>
        <td>{{ CompatNo }}</td>
        <td>{{ CompatNo }}</td>
        <td>{{ unimplemented_inline_webkit("90958") }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li>{{ CSS_Reference:Text }}</li>
</ul>
Revert to this revision