How do DIV css underline text fonts?

Source: Internet
Author: User
Tags html tags

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:

 
  
  
  1. <u> I've been underlined </u>

2. HTML instance Source code

 
  
  
  1. <! DOCTYPE html>
  2. <meta charset= "Utf-8"/>
  3. <title>html Underline Label Instance www.divcss5.com</title>
  4. <body>
  5. I'm divcss5!<br/>.
  6. DIVCSS5 is the website <u>www.divcss5.com</u>!
  7. </body>

Second, the CSS style to implement the underline style

Use CSS style words: text-decoration:underline

1. Grammar

 
  
  
  1. Div{text-decoration:underline}
  2. /* CSS Annotation Description: This expression will allow the div tag text font with the underline * *

2, Div CSS Implementation of the underline instance code

 
  
  
  1. <! doctype html> 
  2. <meta  charset= "Utf-8"  /> 
  3. <title> underscore   strikethrough   underline instance  www.divcss5.com</title > 
  4. <style> 
  5. . Divcss5{text-decoration:underline} /* underline Underline  */ 
  6. . Divcss5_1{text-decoration:line-through} /* line-through Strikethrough Thread  */ 
  7. . Divcss5_2{text-decoration:overline} /* overline underlined  */ 
  8. </style>  
  9.  
  10. <body> 
  11. <div class= Divcs S5 "> I was underlined </div>  
  12. <div class=" Divcss5_1 "> I was added through the strikethrough </div>   
  13. <div class= "Divcss5_2" > I was underlined </div>  
  14. </body> 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.