Decorating Text

With the use of text properties. You can decorate your text such as underline, over line, or strikethrough, by setting the text-decoration property to underline, overline, or line-through, respectively.

Let’s do the following steps to decorate the text present on an HTML Web page:


<!DOCTYPE html>
<html>
<head>
    <title>Aligning Text</title>
    <style type=”text/css”.
    h1 {text-decoration: underline}
    h2 {text-decoration: overline}
    h3 {text-decoration: line-through}
</style>
</head>
<body>
    <h1> This text is underlined.</h1>
    <h2> This text is overlined.</h2>
    <h3> This is a strikethrough text..</h3>
</body>
</html>

Save the document with the name TextDecoration.html and open on browser.

Besides text properties, there is a group of CSS properties, known as font properties, which are also used to change the style of the text present on an HTML Web page.

In this section, you learn about how to work with font properties. You also learn how to set the font family, size, style and weight of the text in next section.