Proficient in CSS advanced Web standard solutions (Chapter 1) Learning Summary

Source: Internet
Author: User

I. Benefits of semantic HTML tags:

1. Easy to process for people and easy to understand for machines (search engines.

2. You can directly set styles for elements without adding other identifiers. This effectively avoids code expansion.

Ii. H4 is created by the document markup language, rather than the interface language. There are no more semantic elements. Currently, there are two main ways to make element semantics:

1. Use H5 tags (H5 includes header, section, article, footer, nav and Other semantic tags ).

2. Use class and ID to assign semantics to existing elements.

Note:

1. Use Id and class to name elements based on what they are, rather than based on their appearance. For more information, see Bootstrap.

2. Do not abuse the class. deleting unnecessary classes helps simplify the code and make the page more concise.

3. Div and span are elements that add a page structure.

Note:

1. Do not use divitus)

2. The DIV should be used when no existing element can achieve regional division. In the following example, no div is required:

1 <div class="nav">2    <ul>3       <li></li>4       <li></li>5    </ull>       6 </div>

You can directly use the following code:

<ul class="nav">     <li></li>     <li></li></ull>

3. When using Div and span, you must know when a compromise must be made and the correct cause.

4. Actually, div is also a semantic block (box ).

Iv. Document Type

1. DTD: Document Type defer is a set of machine-readable rules. Defines what should appear in a specific version of XML or HTML, and does not allow anything to appear.

2. doctype: the browser analyzes the doctype Declaration on the page to find out which DTD to use and which version of HTML to use (DTD is declared by doctype ).

Conclusion: doctype defines which DTD version is used, and DTD defines which html version is used. Therefore, doctype directly determines which html version to use.

Of course, in addition to adding tags Based on semantics (which version is selected), doctype also has the validity verification function. browser mode selection, doctype switching (listener): select the rendering mode based on whether doctype exists, it is used by browsers to distinguish legacy documents from standard documents.

 

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.