EN
CSS - underline text
4
points
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>
Note:
You can also use the HTML solution from the following article: HTML - underline text.