Languages
[Edit]
EN

CSS - underline text

4 points
Created by:
JustMike
3518

In this short article we would like to show how to create underline text with CSS only.

The style property that makes underline effect on text is text-decoration: underline;.

Practical example:

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<head>
  <style>

    span {
        text-decoration: underline;
    }

  </style>
</head>
<body>
  <p>Some text with <span>underline</span> element.</p>
</body>
</html>

 

Hey 👋
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.