To make text underlined in HTML, you can use the <u> element. This element simply indicates that the enclosed text should be visually underlined.

Example:

HTML
<p>This is <u>underlined text</u>.</p>

Note:

  • The <u> element is primarily used for presentation purposes. It doesn't convey any specific semantic meaning about the content.
  • While it's still supported, it's generally considered a legacy element. For modern web design, it's often recommended to use CSS styles to achieve underlining effects.

CSS Alternative:

You can achieve the same effect using CSS styles. For example:

CSS
.underlined-text {
  text-decoration: underline;
}

HTML
<p class="underlined-text">This is underlined text using CSS.</p>

This approach provides more flexibility and control over the appearance of the underlined text, allowing you to customize its color, thickness, and other properties.

In summary:

  • The <u> element is used to make text underlined.
  • It's primarily for presentation purposes.
  • For modern web design, consider using CSS styles for more control and flexibility.