Get the App
SLTechnology News&Howtos  ›  Development  › 

How to add a modifier to the text in a HTML tag

Shulou Source: shulou.com Published: 2022-06-01 07:25:21 10月02日 Update

This article introduces the knowledge of "how to add embellishments to the text in the HTML tag". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Introduction to text-decoration attribute

The text-decoration property is used to set the text modifier. The text-decoration property has a total of four values.

Text-decoration attribute value description table

Value action

None removes the text modifier

Underline sets the underline

Overline settings are underlined

Line-through sets the delete line

HTML tags come with embellishments.

Before starting to practice the text-decoration attribute, the author first popularizes the tags in HTML with embellishments such as: U tag, s tag, if there are any imperfections, you can tell me in the comments below, after all, the author is also a rookie at the front end, hoping to communicate with you, help each other and make progress together.

U label

Let's get into the practice of the u tag, which comes with an underscore of the text.

Set text modifier

Success is not about defeating others, but about changing yourself.

Result diagram

Note: U tags can also be used with other tags in HTML, for example, nesting u tags into H2 tags.

Success is not about defeating others, but about changing yourself.

S label

Let's get into the practice of the s tag, which comes with a text delete line.

Set text modifier

Success is not about defeating others, but about changing yourself.

Result diagram

Note: the s tag can also be nested, consistent with the u tag, the author will not introduce too much.

None removes the finishing line

Let's enter the practice of the none value of the text-decoration attribute, such as: the author removes the delete line from the s tag in the HTML page.

Code block

Set text modifier

S {

Text-decoration:none

}

Success is not about defeating others, but about changing yourself.

Result diagram

Note: the u tag, the s tag, and all modifiers, including the text-decoration attribute value, can be removed.

Underline sets the underline

Let's get into the practice of the underline value of the text-decoration attribute, such as: the author sets an underscore to the text in the h3 tag in the HTML page.

Code block

Set text modifier

H3 {

Text-decoration:underline

}

Success is not about defeating others, but about changing yourself.

Result diagram

Overline settings are underlined

Let's go into the overline value practice of the text-decoration attribute, such as: the author sets the text in the h3 tag in the HTML page to an underline.

Code block

Set text modifier

H3 {

Text-decoration:overline

}

Success is not about defeating others, but about changing yourself.

Result diagram

Line-through sets the delete line

Let's enter the practice of the line-through value of the text-decoration attribute, such as: the author sets the text in the h3 tag in the HTML page to a delete line.

Code block

Set text modifier

H3 {

Text-decoration:line-through

}

Success is not about defeating others, but about changing yourself.

This is the end of the content of "how to add embellishments to the text in HTML tags". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Tags text practice attributes the author success but content results underlining code pages more knowledge practicality consistency learning and then help each other. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Huawei Apple Shulou Information Docker