How do I set the HTML underline? HTML Underline style instance analysis

Source: Internet
Author: User
This article mainly tells about the HTML underline setting method, as well as the HTML underline setting instance, this article all uses the CSS style to manipulate, hoped that everybody grasps the point CSS style basic knowledge.

First, let's talk about how to set the underscore:

We know that the HTML tag has an underscore u tag (<u> is underlined </u>), and you can simply implement the underline style with the underlined text font plus the HTML underline label U. However, in the Div CSS layout, it is sometimes necessary for CSS to implement an underline style effect, which is the CSS underline style.

1.CSS Underline style Word:

Text-decoration

2.CSS Underline code:

Text-decoration:underline

3.css Underline Code Demonstration:

Div{text-decoration:underline}

Underline the text in the Div.

Now say the CSS font with an underscore style instance:

The following is an instance of the CSS underline setting, which sets the underline style for several of the words in a paragraph.

Set the underline CSS style instance code as follows:

<! DOCTYPE html> 

These underline some of the text in a paragraph. As the effect below:

Finally say the div CSS underline settings summary:

You may think that we will use the HTML u tag underline, why use CSS text-decoration style to underline? This is because in the CSS layout is the ever-changing implementation of a variety of layouts, in order to meet the different needs of the general HTML tags can be implemented in the CSS style can be implemented, and sometimes the use of CSS implementation can be conducive to later modification maintenance. But instead of learning CSS instead of using HTML tags to implement the required styles, sometimes HTML tags and CSS styles based on the need to choose the layout of the most suitable for the project is the div CSS layout important essence. Achieve code simplification, code easy to maintain, search engine ranking considerations, programmer easy to use and so on.

OK, the above is the whole content of this article, there are questions can be asked below.

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.