How do you add an underline style to text using a CSS div? Use CSS to add an underline style method tutorial to text fonts.
Underline style for font text, there are two ways to use the HTML underline label directly, the other is to use the CSS underline style.
Next for you to introduce the text font to achieve the Underline method tutorial, through the case way let everybody as two kinds of underline the text style.
One, the HTML tag to achieve underline
Add an underline style to the HTML tags that you want to underline text plus <u></u>.
1. Label Syntax:
- <u> I've been underlined </u>
2. HTML instance Source code
- <! DOCTYPE html>
-
-
- <meta charset= "Utf-8"/>
- <title>html Underline Label Instance www.divcss5.com</title>
-
- <body>
- I'm divcss5!<br/>.
- DIVCSS5 is the website <u>www.divcss5.com</u>!
- </body>
-
Second, the CSS style to implement the underline style
Use CSS style words: text-decoration:underline
1. Grammar
- Div{text-decoration:underline}
- /* CSS Annotation Description: This expression will allow the div tag text font with the underline * *
2, Div CSS Implementation of the underline instance code
- <! doctype html>
-
-
- <meta charset= "Utf-8" />
- <title> underscore strikethrough underline instance www.divcss5.com</title >
- <style>
- . Divcss5{text-decoration:underline} /* underline Underline */
- . Divcss5_1{text-decoration:line-through} /* line-through Strikethrough Thread */
- . Divcss5_2{text-decoration:overline} /* overline underlined */
- </style>
-
-
- <body>
- <div class= Divcs S5 "> I was underlined </div>
- <div class=" Divcss5_1 "> I was added through the strikethrough </div>
- <div class= "Divcss5_2" > I was underlined </div>
- </body>
-