text-decoration-line

  • Revision slug: Web/CSS/text-decoration-line
  • Revision title: text-decoration-line
  • Revision id: 487517
  • Created:
  • Creator: bfrohs
  • 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.

{{cssbox("text-decoration-line")}}

Syntax

Formal syntax: {{csssyntax("text-decoration-line")}}
text-decoration-line: none /* This is the only keyword that cannot be mixed with other */

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

text-decoration-line: inherit

Values

Accepts none, or 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.
blink
The text blinks (alternates between visible and invisible). Conforming user agents may simply not blink the text. This value is deprecated in favor of Animations.
-moz-anchor-decoration
Mozilla CSS Extension, not suitable for web content.

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 {{ unimplemented_inline_webkit(90959) }} {{ CompatGeckoDesktop("6.0") }}{{ property_prefix("-moz") }} {{ CompatNo() }} {{ CompatNo() }} {{ unimplemented_inline_webkit(90959) }}
blink {{ CompatNo() }} {{ CompatGeckoDesktop("26.0") }} [1] {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ unimplemented_inline_webkit(90959) }} {{ unimplemented_inline_webkit(90959) }} {{ CompatGeckoMobile("6.0") }} {{ property_prefix("-moz") }} {{ CompatNo() }} {{ CompatNo() }} {{ unimplemented_inline_webkit(90959) }}
blink {{ CompatNo() }} {{ CompatNo() }} {{ CompatGeckoMobile("26.0") }} {{ property_prefix("-moz") }} [1] {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}

[1] The value is considered valid, but no blinking will happen, as the spec allows user agents to ignore it.

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>
<p>{{cssbox("text-decoration-line")}}</p>
<h2 id="Syntax" name="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-line")}}
</pre>
<pre>
text-decoration-line: none /* This is the only keyword that cannot be mixed with other */

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

text-decoration-line: inherit
</pre>
<h3 id="Value" name="Value">Values</h3>
<p>Accepts <strong>none</strong>, or <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>blink</code></dt>
 <dd>
  The text blinks (alternates between visible and invisible). Conforming user agents may simply not blink the text. This value is <strong>deprecated</strong> in favor of <a href="/en-US/docs/Web/CSS/animation">Animations</a>.</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="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>{{ unimplemented_inline_webkit(90959) }}</td>
    <td>{{ CompatGeckoDesktop("6.0") }}{{ property_prefix("-moz") }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ unimplemented_inline_webkit(90959) }}</td>
   </tr>
   <tr>
    <td><code>blink</code></td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatGeckoDesktop("26.0") }} [1]</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</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(90959) }}</td>
    <td>{{ unimplemented_inline_webkit(90959) }}</td>
    <td>{{ CompatGeckoMobile("6.0") }} {{ property_prefix("-moz") }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ unimplemented_inline_webkit(90959) }}</td>
   </tr>
   <tr>
    <td><code>blink</code></td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatGeckoMobile("26.0") }} {{ property_prefix("-moz") }} [1]</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
    <td>{{ CompatNo() }}</td>
   </tr>
  </tbody>
 </table>
</div>
<p name="See_also">[1] The value is considered valid, but no blinking will happen, as the spec allows user agents to ignore it.</p>
<h2 id="See_also" name="See_also">See also</h2>
<ul>
 <li>{{ CSS_Reference:Text() }}</li>
</ul>
Revert to this revision