Decorating Text

Description

text-decoration applies a decoration to a block of text, such as underlining it.

Its possible values are:none underline overline line-through blink.

The default value is none and no decoration is applied.

Example

The following code shows how to use the text-decoration and text-transform Properties.


<!DOCTYPE HTML>
<html>
<head>
<style>
p  {<!--from w ww .ja  v  a2s.c om-->
    border: medium double black;
    background-color: lightgrey;
    text-decoration: line-through;
    text-transform:  uppercase;
}
p.one {
    text-decoration: underline;
}
p.two {
    text-decoration: overline;
}
p.three {
    text-decoration: line-through;
}
p.four {
    text-decoration: underline overline line-through;
}
</style>
</head>
<body>
    <p>this is a test.</p>
    <p class="one">A underlined line</p>
    <p class="two">An overlined line</p>
    <p class="three">A line with line-through</p>
    <p class="four">All three</p>
    
</body>
</html>

Click to view the demo





















Home »
  HTML CSS »
    CSS »




CSS Introduction
CSS Background
CSS Border
CSS Box Layout
CSS Text
CSS Font
CSS Form
CSS List
CSS Selectors
CSS Others
CSS Table