Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the new elements in HTML 5

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

In this issue, Xiaobian will bring you about the new elements of HTML 5. The article is rich in content and analyzed and described from a professional perspective. After reading this article, I hope you can gain something.

When it comes to HTML rendering, browsers are stuck at 1999 levels. To that end, HTML 5 is a pragmatic solution that not only continues to work with HTML scattered around the world for so many years, but also makes it easier for browser vendors to add new features. This is called degradation gracefully. Let's take a look at some of the new elements added to HTML 5.

HTML 5 structural elements

This was a great relief. At present, we can only define the structure through a "***" div, trying to express the head, bottom or sidebar respectively by setting the value of its attribute id such as header, footer, sidebar, etc. With them, code writers no longer have to worry about id naming, which has more semantic benefits for mobile phones, readers and other devices. HTML 5 adds new structural elements to express these most commonly used structures:

section: This can mean a section of a book or a chapter, or a section within a chapter

header: The header on the body of the page. Not a head element

footer: The bottom of the page (footer), which can be where an email signature is located

nav: a collection of links to other pages

Article: An independent entry in a blog, magazine, compendium, etc.

For example, the first page of a blog, written in HTML 5, can look like this (with omissions):

trajectory 1 navigation 2 ...

© 2007 realazy

Semantic elements of block-level blocks

HTML also adds the following three block-level elements:

◆aside

◆figure/code>

◆dialog

Side can be used to express notes, tips, sidebars, abstracts, inserted citations, etc., such as content that supplements the body. For example, the sidebar of the blog is expressed as follows:

*** Articles article title ...

The figure element represents a block-level picture with a caption. For example:

Here's the caption for the picture.

图片可替换文本

The dialog element is used to express conversations between people. In HTML 5, dt is used to represent the speaker, and dd is used to represent the speaker's content. For example:

Buddha color is empty Wukong

I now need to dot empty…inline semantic elements, m elements to mark some text that doesn't need to be emphasized so much. It is controversial now and may eventually be changed to mark.

The time element, as its name suggests, is used to express time. It requires a datetime property to indicate the time that the machine can recognize, such as:

August 8, 2008 8:08 PM 8:08 PM The meter element expresses a value within a specified range. Can be used for salary, percentage, fraction, etc. For example:

I'm sorry to tell you, I only have 150cm, and it has six other characteristics to express various meanings, such as:

Your score is: B+.

There is also a progress, which is also the name, to express progress:

Target Completion: 40% Embedded Multimedia

Added video and audio elements. As the name suggests, it is used to insert video and sound respectively. As for formatting, leave it to browsers to implement, and HTML no longer requires special code to play a particular format. Just like img, png, jpg or gif can be displayed. It is worth noting that they can contain content. For example, you can put lyrics into a song:

dry tears

How can I feel wronged?

There was a moment of sadness and joy

...

interactivity

HTML 5, also known as Web Applications 1.0, further developed interactivity. These tags were created to enhance the interactive experience of the page:

details

datagrid

menu

command

Details is used to indicate a specific piece of content, but the content may not be displayed by default. It is displayed by some means (such as clicking) and interacting with legend. This is similar to the current practice of hiding a piece of content through JavaScript and showing it after clicking. For example:

A word to record the little bit of life, more

Communication and sharing, close you and friends, support MSN/GTalk/QQ, SMS, mobile WAP

It can have an open feature to show details or not.

Datagrid is used to control data and can be updated by users or scripts.

menuHTML 2 exists, but HTML 4 obsolutes it. HTML5 Waste Utilization, with command elements added during the period.

The above is what the new elements of HTML 5 shared by Xiaobian are. If there are similar doubts, please refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report