Table of Contents
article element
section element
nav element
aside element
time element
Home Web Front-end Front-end Q&A What are the main structural elements of html5

What are the main structural elements of html5

Feb 25, 2022 pm 05:15 PM
html5

html5 The main structure elements are: 1. article element, defining independent content; 2. section element, defining sections in the document; 3. nav element, defining part of the navigation link; 4. aside element, defining The sidebar part of the document; 5. The time element defines the date or time.

What are the main structural elements of html5

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

The main structure element is for structuring semantics, for better SEO, and for browsers to better capture data. The elements included mainly include article, section, nav, aside, and time.

article element

The article tag is semantically considered a document or a page. Usage: Usually an article, page, an independent complete content. The emphasis is on independence. Articles can be nested within each other and usually have header tags, which can be regarded as special section elements (explained later). Highly used, the code is as follows:

<!DOCTYPE HTML>
<html>
<body>
<article>  
  <header>    
    <h1> apple教程</h1>   
    <p>时间:<time pubdate="pubdate">2013-2-1</time></p>   
  </header>   
  <p>轻松学习apple教程,就来</p>
  <a href="http://www.apple.com">www.apple.com</a><br />   
  <footer>  
    <p><small>底部版权信息:apple.com公司所有</small></p>   
  </footer>  
 </article>
</body>
</html>
Copy after login

section element

section element semantics is section, usage: used for a certain paragraph of content in the page, such as a paragraph of an article, usually composed of title and content , section is not recommended for sections without titles. Sections can nest article elements because articles are more independent. The frequency of use is low and the emphasis is on segmentation and chunking. The code is as follows:

<!DOCTYPE HTML>
<html>
<body>
   <section>
   <h2>section元素使用方法</h2>
    <p> section元素用于对网站或应用程序中页面上的内容进行分块。</p>
   </section>
</body>
 </html>
Copy after login

Note: When a container needs to be styled or instep defined, it is recommended to use p. Do not use section.

The nav element semantics is navigation. Usage: Generally used as the navigation part of the page, it is used frequently. The code is as follows:

<html>
<body>
<nav>
    <ul>
        <li><a href="">菜单1</a></li>
        <li><a href="">菜单2</a></li>
        <li><a href="">菜单3</a></li>
    </ul>
</nav> 
</body>
 </html>
Copy after login

aside element

aside element semantics are beside and side. Usage: When used in the article tag, it is used as ancillary information part of the main content, such as relevant reference materials, Glossary of terms, etc. When used outside the article tag, it serves as the global ancillary information part of the page or site, such as the sidebar, the friendly link part of the blog, the advertising area, etc. Frequency of use is low. The code is as follows:

<!DOCTYPE HTML>
<html>
<body>
<!-- 在article标签内使用时 -->
<article>
    <h1>马云是谁</h1>
    <p>马云,男,1964年10月15日出生于浙江省杭州市,中国著名企业家,阿里巴巴集团、淘宝网、支付宝创始人..........</p>
    <aside>
        <h1>参考资料</h1>
        <p>百度网、维基百科...</p>
    </aside>
</article>
 
<!-- 在article标签外使用时 侧导航栏-->
<aside>
    <nav>
        <ul>
            <li><a href="">老赵的博客</a></li>
            <li><a href="">鬼哥的博客</a></li>
            <li><a href="">彪叔的博客</a></li>
        </ul>
    </nav>
</aside> 
</body>
</html>
Copy after login

time element

The time element is a time tag. Usage: Represents a certain moment or date in 24 hours. Time difference is allowed when representing the moment. Date and time in many formats can be defined. The frequency of use is low. The code is as follows:

<!DOCTYPE HTML>
<html>
<meta charset=&#39;utf-8&#39;>
<body>
<aside>
    <time datetime="2013-3-6">2014年3月6日</time>
    <br/>
    <!-- datetime属性中日期与时间之间要用“T” 文字分隔,“T”表示时间 -->
    <time datetime="2013-3-6T20:00">2014年3月6日20:00</time>
    <br/>
    <!-- 时间加上“Z”表示给机器编码时使用UTC标准时间 -->
    <time datetime="2013-3-6T20:00Z">2014年3月6日20:00</time> 
</aside> 
</body>
</html>
Copy after login

[Recommended courses: HTML5 video tutorial, web front-end introductory tutorial]

The above is the detailed content of What are the main structural elements of html5. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles