HTML

Underlined Text


Underlined text in HTML can be used to emphasize certain parts of the content or to indicate links. However, underlining text solely for emphasis is generally not recommended in web design, as underlined text is conventionally associated with hyperlinks. There are several ways to underline text in HTML, depending on your needs.

 

Using the <u> Tag

The <u> tag is used to underline text. It should be used sparingly, primarily for non-link text that requires an underline for a specific reason, such as denoting a proper name in Chinese or highlighting a misspelled word.

<!DOCTYPE html>
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Underlined Text Example</title>
</head>
<body>
    <p>This is an <u>underlined</u> word.</p>
</body>
</html>