Article and Section elements in HTML5

Source: Internet
Author: User

HTML5 brings out a series of new elements and will be widely used in the future. However, some elements are confusing when used, including the following two new elements: <article> and <section>. The most frequently asked question is: under what circumstances should we use these elements? And how should we correctly use these elements? Related Tutorials: Section element of HTML5 tutorial Section of GBin1 is the most ambiguous element. What is the difference between it and <div> elements? We have been using <div> to divide paragraphs, so after <div>, when should we use this element. We will refer to the official document to describe it. According to the WHATWG document, the <section> element is described as follows: "The <section> element indicates a document or application, general section-WHATWG "from the description, we can see that the role of the <section> element is segmentation, more or less similar to <div>. However, it still has a special case. In this document, a special statement is added: "When an element is used only for style styles or for the convenience of scripts, we encourage the author to use <div>. <Section> the element applies when the content of the element needs to be explicitly listed. -WHATWG "based on this, we can summarize the following two points: first, although section elements can be technically designed for styles, when there are complex styles or scripts, we still recommend that you use the div element. Second, similar to the <li> element, the section element is used to list content. The reason for using the <section> element is to list the Blog content in a structured manner. The Code is as follows: <div class = "blog"> <section class = "post">

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.