Home > Article > Web Front-end > How to underline html pages
There are two ways to create underlined text in HTML: Use the <u> tag to add an underline to the text. Use the CSS style text-decoration: underline; to apply underlining to text.
htmlHow to underline web pages
In HTML web pages, there are two ways to create underlined text.
Use underline tags
The easiest way is to use the <u>
tag:
<code class="html"><u>下划线文本</u></code>
This will give the text Add an underscore.
Using CSS Styles
You can also use CSS styles to create underlines:
<code class="css">text-decoration: underline;</code>
Then, apply it to the text you want to underline:
<code class="html"><p style="text-decoration: underline;">下划线文本</p></code>
Choose the best method
Which method you choose depends on your specific needs. <u>
Tags are a quick and easy way, while CSS styles provide more control and flexibility. If you need more control, for example, changing the color or thickness of the underline, you can use CSS styles.
The above is the detailed content of How to underline html pages. For more information, please follow other related articles on the PHP Chinese website!