InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

CSS properties

  • CSS3 flexbox
  • all
  • animation
  • background-color
  • background-image
  • border
  • border-color
  • border-radius
  • border-style
  • border-width
  • bottom
  • box-shadow
  • box-sizing
  • calc function
  • clip
  • color
  • color value currentColor
  • color values
  • cursor
  • float
  • font
  • font-family
  • font-size
  • font-style
  • font-variant
  • font-weight
  • generated content
  • left
  • letter-spacing
  • line-height
  • list-style
  • list-style-image
  • list-style-position
  • list-style-type
  • margin
  • max-height
  • max-width
  • min-height
  • min-width
  • opacity
  • outline
  • outline-color
  • outline-style
  • outline-width
  • overflow
  • padding
  • pointer-events
  • position
  • resize
  • right
  • text-align
  • text-decoration
  • text-indent
  • text-overflow
  • text-shadow
  • text-transform
  • top
  • transform
  • transition
  • transition-delay
  • transition-duration
  • transition-property
  • transition-timing-function
  • visibility
  • white-space
  • word-break
  • word-spacing
  • word-wrap/overflow-wrap
  • z-index
 
  • Home
  • > Tutorials
  • > CSS
  • > CSS properties

CSS text-decoration – underline, overline and strikeout text

on Mar 23, 2016

CSS property text-decoration describes decorations that are added to the text of an element using the element’s color. Few points to note about text-decoration

  1. Underlines, overlines, and line-throughs are applied only to text (including white space, letter spacing, and word spacing).
  2. margins, borders, and padding are skipped
  3. Value blink is not well supported (does not work in Chrome)

CSS property text-decoration

CSS version: CSS 2.1
Value: none | [ underline || overline || line-through || blink ] | inherit
Initial: none
Applies to: all elements
Inherited: no

text-decoration values

noneNo decoration
underlineEach line of text is underlined.
overlineEach line of text has a line above it.
line-throughEach line of text has a line through the middle.
blinkText blinks (alternates between visible and invisible). Not well supported. Does not work in Chrome.
inheritinherit value from parent

Example – text-decoration

<style> 
span {margin: 5px;}
.underline {text-decoration: underline;}
.overline {text-decoration: overline;}
.line-through {text-decoration: line-through;}
</style>

<span class="underline">Underline example</span>
<span class="overline">Overline example</span>
<span class="line-through">Line through example</span>
refresh done
try it online

Related

  • CSS letter-spacing - additional spacing between adjacent chars
  • CSS text-align - align text left, right or justify
  • CSS text-indent - indent text in a block
  • CSS text-transform - capitalize, uppercase and lowercase text
  • CSS word-spacing - additional space between words

Specification

  • W3C CSS 2.1 text-decoration specification

Suggested posts:

  1. Running php eval on code with tags
  2. CSS letter-spacing – additional spacing between adjacent chars
  3. CSS adjacent sibling selector
  4. CSS border-color – define color of four borders
  5. CSS text-indent – indent text in a block
  6. CSS box-shadow
  7. jQuery sliding effect – slideUp, slideDown, slideToggle
  8. Jenkins – how to delete old builds
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged CSS, CSS properties, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress