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 and discarded tags in html5?

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

Share

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

This article "html5 new and discarded tags what are the knowledge points of most people do not understand, so the editor summarized the following content, detailed, clear steps, with a certain reference value, I hope you can get something after reading this article, let's take a look at this" html5 new and discarded tags have what "article.

I. abandoned labels

The following HTML 4.01elements have been deleted in HTML5. Although browsers still support these tags for compatibility reasons, it is recommended to use new alternative tags. Paradoxically, the old browser does not have enough support for the new tags, depending on the audience of the project.

1. Elements that can be replaced by CSS

These elements include basefont, big, center, font, s, strike, tt, u. These elements are purely for page presentation, and the content of the presentation should be done by CSS.

2. Frame framework

These elements include frameset, frame, and noframes. The frame framework is not supported in HTML5, only the iframe framework is supported, or the above three tags are deleted in the form of multiple pages created by the server.

3. Elements supported by only some browsers

These elements contain tags like applet, bgsound, blink, marquee, and so on.

4. Other abolished elements

Abolish rb, use ruby substitute repeal acronym use abbr substitute repeal dir use ul substitute abolish isindex use form and input replace repeal listing use pre replace repeal xmp use code substitute repeal nextid use guids abolish plaintex use "text/plian" (unformatted body) MIME type substitution

II. New labels

1. New structure tags

In HTML4.01, div is widely used in various layout environments, but there is no clear definition. HTML5 semantics div for SEO. The new structure tags are as follows:

A), the section element represents a content block in the page, such as a chapter, header, footer, or other part of the page. Can be with H2, H3. And other elements are combined to represent the document structure. Example: in HTML5... In HTML4.

B) the article element represents a piece of independent content on the page that is not relevant to the context. Like an article.

C) the aside element represents auxiliary information related to the content of the article element other than the content of the article element.

D), the header element represents a content block in the page or the title of the real page.

E), hgroup elements represent a combination of the title of a real page or a content block in a page.

F), the footer element represents the footnote of the entire page or a content block in the page. Generally speaking, he will include the name of the creator, the date of creation, and the creator's contact information.

G), the nav element represents the part of the navigation link in the page.

H), the figure element represents a separate stream content, which generally represents an independent unit in the main stream content of the document. Use the figcaption element to add a title to the figure element group. For example:

PRC

The People's Republic of China was born in 1949

Often written in HTML4:

Prc

The People's Republic of China was born in 1949

Running result:

2. Add other elements

2.1 、 meter

Represents a numerical value within a specific range, and can be used for wages, quantities, percentages, etc. Max represents the maximum value, min represents the minimum value, and value represents the current value.

You can use js control to change it from 0 to 100.

2.2 、 time

Time . Indicates the time value, and the attribute datetime emphasizes the time conference time: 2015-10-6

2015-10-6

We start class at 8:30 every morning. I have an appointment on Valentine's Day.

Because the tag is a semantic tag, it has no special effect when viewed on the browser, which is basically the same as no tag.

2.3 、 progress

Used to represent a progress bar:

Progress

Max: maximum, value at completion

Value: current valu

2.4 、 datalist

This label defines a list of optional data. In conjunction with the input element, you can create a drop-down list of input values.

When combined with input, the selection can be completed and some can be entered.

2.5, mark element

It is mainly used to visually present to the user what text needs to be highlighted or highlighted. The search keyword is highlighted in the search results of a typical application. HTML5;HTML4 .

2.6.The ruby element

Define ruby comments (Chinese phonetic or character). Use with and tags. The ruby element consists of one or more characters (requiring an explanation / pronunciation) and a rt element that provides this information, as well as an optional rp element that defines what to display when the browser does not support the "ruby" element.

2.7.The rt element

Define the interpretation or pronunciation of characters (Chinese Bopomofo or characters).

2.8.The rp element

Used in ruby comments to define what is displayed by browsers that do not support ruby elements.

2.9.The wbr element

Represents a soft line break. The difference from the br element: the br element indicates that the line must be wrapped here; wbr means that when the browser window or parent element is wide (when there is no need for a line break), there is no line break, and if the width is not enough, take the initiative to wrap the line here.

2.10. Canvas element

Define graphics, such as charts and other images. Elements are just graphics containers (canvases) and must be drawn using scripts.

Var canvas = document.getElementById ('myCanvas'); var ctx = canvas.getContext (' 2d'); ctx.fillStyle ='# FF0000'; ctx.fillRect (0,0,80,100)

2.11. Command element

Represents a command button, such as a radio button, check box, or button. The command element is visible only if it is within the menu element. Otherwise, this element will not be displayed, but you can use it to specify keyboard shortcuts.

Play function setVolume (obj) {document.getElementById ("mp3") .volume=obj.value*0.01;}

The volume is only between 0 and 1.

3.3.The embed element

Used to embed content (including various media). The format can be Midi, Wav, AIFF, AU, MP3,flash, etc.

Example: code example in HTML4

The above is about the content of this article on "what are the new and discarded tags in html5?" I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow 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