Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the new understandings about HTML5

Shulou Source: shulou.com Published: 2022-06-03 14:13:20 11月14日 Update

This article introduces you about the new understanding of HTML5, the content is very detailed, interested friends can refer to, hope to be helpful to you.

1. New Doctype

Despite the use, even if the browser does not understand this sentence, it will render in standard mode.

2. Figure element

Use and to semantically represent a picture with a title

About image

This is an image of something interesting.

3. Redefined

Has been redefined and is now used to denote small typesetting, such as the copyright notice at the bottom of the website

4. Remove the type attribute from the link and script tags

5. With / without parentheses

HTML5 does not strictly require that attributes must be closed in quotation marks, but it is recommended to add quotation marks and closing tags.

6. To make your content editable, just add a contenteditable attribute

7. Email Inputs

If we set the type of Input to email, the browser will verify whether the input is of type email. Of course, we can't only rely on the front-end verification, but also the back-end verification.

8. Placeholders

The meaning of this input attribute is that you don't have to use javascript to do the placeholder effect.

9. Local Storage

Using Local Storage, you can permanently store large pieces of data on the client (unless actively deleted). At present, most browsers already support it. You can detect the existence of window.localStorage before using it.

10. Semantic header and footer

11. More HTML5 form features

12. IE and HTML5

By default, new HTML5 elements are rendered as inline, but you can make

It is rendered in block mode

Header, footer, article, section, nav, menu, hgroup {

Display: block

}

Unfortunately, IE ignores these styles, and you can fix them like this:

Document.createElement ("article")

Document.createElement ("footer")

Document.createElement ("header")

Document.createElement ("hgroup")

Document.createElement ("nav")

Document.createElement ("menu")

13. Hgroup

It is generally used in header to group a set of headings together, such as

Recall Fan Page

Only for people who want the memory of a lifetime.

14. Required attribute

The required attribute defines whether an input is required, and you can declare it as follows

Or

15. Autofocus attribute

Just like its meaning, it is focused on the input box.

16. Audio support

HTML5 provides tags, you no longer need to render audio according to third-party plug-ins, most modern browsers provide support for HTML5 Audio, but you still need to provide some compatible processing, such as

Download this file.

17. Video support

Much like Audio, tags provide support for video, and because the HTML5 document does not specify a specific encoding for video, the viewer decides which encodings to support, resulting in a lot of inconsistencies. Safari and IE support H.264 encoding format, Firefox and Opera support Theora and Vorbis encoding format, when using HTML5 video, you must provide both:

Download this video instead.

18. Preload video

The preload property is as simple as its literal meaning, and you need to decide whether you need to preload the video when the page loads.

19. Display video control

20. Regular expression

Because of the pattern attribute, we can use regular expressions directly in your markup.

Create a Username:

Input [type=range]: before {content: attr (min); padding-right: 5px

}

Input [type=range]: after {content: attr (max); padding-left: 5px;}

This is the end of the new knowledge about HTML5. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Attribute support element time tag browser Encoding browsing content method more Video Detection closure Cognition can be passed that is quotation marks effect title Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Xiaomi Huawei NVidia macOS