text-decoration-line

  • Revision slug: CSS/text-decoration-line
  • Revision title: text-decoration-line
  • Revision id: 327691
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

Summary

The text-decoration-line CSS property sets what kind of line decorations are added to an element.

Underline and overline decorations are positioned under the text, line-through over it.

  • {{ Xref_cssinitial() }} none
  • Applies to all elements
  • {{ Xref_cssinherited() }} no
  • Media {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }} as specified

Syntax

text-decoration-line: none | underline || overline || line-through

Values

Accepts one or more whitespace separated values:

none
Produces no text decoration.
underline
Each line of text is underlined.
overline
Each line of text has a line above it.
line-through
Each line of text has a line through the middle.
-moz-anchor-decoration
Mozilla CSS Extension, not suitable for web content.

Notes

In contrast to {{ cssxref("text-decoration") }}, the -moz-text-decoration-line property does not accept the blink value. You might use {{ cssxref("-moz-text-blink") }} instead.

Examples

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

Specifications

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

Browser compatibility

{{ CompatibilityTable() }}

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

See also

  • {{ CSS_Reference:Text() }}

Revision Source

<div>
  {{ CSSRef() }}</div>
<h2 id="Summary" name="Summary">Summary</h2>
<p>The <code>text-decoration-line</code> CSS property sets what kind of line decorations are added to an element.</p>
<p>Underline and overline decorations are positioned under the text, line-through over it.</p>
<ul class="cssprop">
  <li><dfn>{{ Xref_cssinitial() }}</dfn> <code>none</code></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> as specified</li>
</ul>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">
text-decoration-line: none | underline || overline || line-through
</pre>
<h3 id="Value" name="Value">Values</h3>
<p>Accepts <strong>one or more</strong> whitespace separated values:</p>
<dl>
  <dt>
    <code>none</code></dt>
  <dd>
    Produces no text decoration.</dd>
  <dt>
    <code>underline</code></dt>
  <dd>
    Each line of text is underlined.</dd>
  <dt>
    <code>overline</code></dt>
  <dd>
    Each line of text has a line above it.</dd>
  <dt>
    <code>line-through</code></dt>
  <dd>
    Each line of text has a line through the middle.</dd>
  <dt>
    <code>-moz-anchor-decoration</code></dt>
  <dd>
    <a href="/en-US/docs/CSS/CSS_Reference/Mozilla_Extensions" title="CSS_Reference/Mozilla_Extensions">Mozilla CSS Extension</a>, not suitable for web content.</dd>
</dl>
<h2 id="Notes" name="Notes">Notes</h2>
<p>In contrast to {{ cssxref("text-decoration") }}, the <code>-moz-text-decoration-line</code> property does <strong>not</strong> accept the <code>blink</code> value. You might use {{ cssxref("-moz-text-blink") }} instead.</p>
<h2 id="Examples" name="Examples">Examples</h2>
<pre class="brush: css; highlight:[2]">
.example { 
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: red;
}</pre>
<h2 id="Specifications" name="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-line', 'text-decoration-line') }}</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>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoDesktop("6.0") }}{{ property_prefix("-moz") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</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>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoMobile("6.0") }}{{ property_prefix("-moz") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also" name="See_also">See also</h2>
<ul>
  <li>{{ CSS_Reference:Text() }}</li>
</ul>
Revert to this revision