Add underline to HTML page text

Do web pages have to have hyperlinks to have bottom lines? Not necessarily! When you need to add an underline to some text to indicate its importance, you can use the tag <u> in HTML to set the text underline, or you can use CSS text-decoration to design. The methods are easy, but the text-decoration has many changes, and you can also add effects such as strikethrough or online. The following two different writing examples are prepared for reference.


Example of adding bottom line to HTML page text 1. Use the <u> tag
<u>I am the underlined text</u>
The example presents the effect as
I am the underlined text
It is very traditional to underline the text through the <u> tag. The standard u tag starts with <u> and ends with </u>. The text wrapped in the tag will be underlined, whether it is or not For the status of hyperlinks, other commonly used special tags include <b> for bold and <I> for italics. For more information, please refer to the special effects table of "HTML font text".

Example of adding bottom line to HTML page text 2: Use CSS text-decoration syntax
<span style="text-decoration:underline;">I am the underlined text</span>
The example presents the effect as
I am the underlined text
In this example, first wrap the text to be marked with a span tag, and use style to set the style. The parameter underline of text-decoration represents the bottom line, and other parameters include strikethrough line-through, overline overline and other different styles. The simple <u> tag is much richer and is supported by mainstream browsers.

Post a Comment

0 Comments