There are two ways to create underline code in HTML: usetags to wrap the text and use CSS to control the style, defined by text-decoration: underline, and then apply the CSS class on the text
HTML underline code
There are two ways to create underline code in HTML:
Method 1 : Use thetag
This method is the simplest, just use thetag to wrap the text:
这是下划线文本
Method 2: Use CSS
Use CSS to more flexibly control the underline style, such as thickness and color:
.underlined { text-decoration: underline; }
Then apply this CSS class on the text you want to underline:
这是下划线文本
The above is the detailed content of How to write html underline code. For more information, please follow other related articles on the PHP Chinese website!