text-decoration
Quick Summary for text-decoration
The text-decoration shorthand CSS property sets the appearance of decorative lines on text. It is a shorthand for text-decoration-line, text-decoration-color, text-decoration-style, and the newer text-decoration-thickness property.
Code Usage for text-decoration

<pre class="brush: css notranslate"><code><span class="token property">text-decoration</span><span class="token punctuation">:</span> underline<span class="token punctuation">;</span> <span class="token property">text-decoration</span><span class="token punctuation">:</span> overline red<span class="token punctuation">;</span> <span class="token property">text-decoration</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span> <span class="token comment">/ Global values /</span> <span class="token property">text-decoration</span><span class="token punctuation">:</span> inherit<span class="token punctuation">;</span> <span class="token property">text-decoration</span><span class="token punctuation">:</span> initial<span class="token punctuation">;</span> <span class="token property">text-decoration</span><span class="token punctuation">:</span> revert<span class="token punctuation">;</span> <span class="token property">text-decoration</span><span class="token punctuation">:</span> unset<span class="token punctuation">;</span> </code></pre>

More Details for text-decoration

text-decoration

The text-decoration shorthand CSS property sets the appearance of decorative lines on text. It is a shorthand for text-decoration-line, text-decoration-color, text-decoration-style, and the newer text-decoration-thickness property.

Text decorations are drawn across descendant text elements. This means that if an element specifies a text decoration, then a child element can't remove the decoration. For example, in the markup <p>This text has <em>some emphasized words</em> in it.</p>, the style rule p { text-decoration: underline; } would cause the entire paragraph to be underlined. The style rule em { text-decoration: none; } would not cause any change; the entire paragraph would still be underlined. However, the rule em { text-decoration: overline; } would cause a second decoration to appear on "some emphasized words".

Constituent properties

This property is a shorthand for the following CSS properties:

text-decoration-color text-decoration-line text-decoration-style text-decoration-thickness

Syntax

text-decoration: underline; text-decoration: overline red; text-decoration: none;  /* Global values */ text-decoration: inherit; text-decoration: initial; text-decoration: revert; text-decoration: unset; 

The text-decoration property is specified as one or more space-separated values representing the various longhand text-decoration properties.

Values

text-decoration-line

Sets the kind of decoration used, such as underline or line-through.

text-decoration-color

Sets the color of the decoration.

text-decoration-style

Sets the style of the line used for the decoration, such as solid, wavy, or dashed.

text-decoration-thickness

Sets the thickness of the line used for the decoration.

Formal definition

Initial valueas each of the properties of the shorthand:text-decoration-color: currentcolortext-decoration-style: solidtext-decoration-line: none
Applies toall elements. It also applies to ::first-letter and ::first-line.
Inheritedno
Computed valueas each of the properties of the shorthand:text-decoration-line: as specifiedtext-decoration-style: as specifiedtext-decoration-color: computed colortext-decoration-thickness: as specified
Animation typeas each of the properties of the shorthand:text-decoration-color: a colortext-decoration-style: discretetext-decoration-line: discretetext-decoration-thickness: by computed value type

Formal syntax

<'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> || <'text-decoration-thickness'>

Examples

Demonstration of text-decoration values

.under {   text-decoration: underline red; }  .over {   text-decoration: wavy overline lime; }  .line {   text-decoration: line-through; }  .plain {   text-decoration: none; }  .underover {   text-decoration: dashed underline overline; }  .thick {   text-decoration: solid underline purple 4px; }  .blink {   text-decoration: blink; } 
<p class="under">This text has a line underneath it.</p> <p class="over">This text has a line over it.</p> <p class="line">This text has a line going through it.</p> <p>This <a class="plain" href="#">link will not be underlined</a>,     as links generally are by default. Be careful when removing     the text decoration on anchors since users often depend on     the underline to denote hyperlinks.</p> <p class="underover">This text has lines above <em>and</em> below it.</p> <p class="thick">This text has a really thick purple underline in supporting browsers.</p> <p class="blink">This text might blink for you,     depending on the browser you use.</p> 

Specifications

Specification
CSS Text Decoration Module Level 3 # text-decoration-property

See also

The individual text-decoration properties are text-decoration-line, text-decoration-color, text-decoration-style, and text-decoration-thickness. The text-decoration-skip-ink, text-underline-offset, and text-underline-position properties also affect text-decoration, but are not included in the shorthand. The list-style attribute controls the appearance of items in HTML <ol> and <ul> lists. Select your preferred language English (US)DeutschEspañolFrançais日本語한국어Português (do Brasil)中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

You could also follow me on twitter. I have a couple of youtube channels if you want to see some video related content. RuneScape 3, Minecraft and also a coding channel here Web Dev.

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote

Please dont do this! 😜


Unknown Web Developer
Latest News
## 🚀 AI Giants Hit Bullseye: Anthropic & OpenAI Achieve Product-Market Fit Anthropic and OpenAI have reached a significant milestone, finding product-market fit with their AI technologies, which means their products effectively meet the needs of their customers, driving growth and adoption. This achievement showcases the practical value of their innovations, enabling businesses and individuals to leverage AI for enhanced productivity and efficiency. With this alignment of product and market needs, these companies are poised to transform industries and shape the future of technology.