HTML5 tags and features
HTML5 is no longer a subset of SGML. It mainly adds functions such as images, locations, storage, and multitasking. HTML5 is an upgraded version of HTML4. Compared with the latter, HTML5 adds the expressiveness of Web pages and new functions such as forms and local data, the construction of our website is a brand new experience and an opportunity, because the innovation and reform of all the functions in HTML5 will be a good guide for our future website construction.
Painting CANVAS;
The video and audio elements used to play the media;
Local offline storage localstorage stores data for a long time. Data is not lost after the browser is closed; sessionstorage data is automatically deleted after the browser is closed;
Better semantic content elements include: article, footer, header, nav, and section;
Form Control. The type attributes include calendar, date, time, email, URL, and search;
Removed elements include: basefont, big, center, font, s, strike, tt, and u. elements that have negative impact on availability: frame, frameset, noframes;
Support HTML5 new tags: ie8, ie7, and ie6 support document. the tags generated by the createElement method can be used to allow these browsers to support html5 new tags. After the browser supports new tags, you also need to add the default tag style.
The input tag adds many new attributes. Let's list them:
Specify the autofocus attribute for input, select, textarea, And button. It allows the element to automatically obtain the focus after the page is loaded by specifying attributes. Only one element on a page can have the autofocus attribute. If multiple elements are set at the same time, the first element takes effect. When the input box obtains the focus, the character disappears.
This attribute is useful for login pages and can improve user experience. Sometimes the login page has a user name and password. After the page is loaded, the user must manually locate the input box to enter it. With autofocus, open the page and enter it directly.
The max, min, and step attributes are added to datepickers, number, and range of input. The max attribute specifies the maximum value allowed by the input field.
The min attribute specifies the minimum value allowed by the input field.
The step attribute specifies a valid numeric interval for the input field. (If step = "3", the valid number should be-3, 0, 3, 6, and so on) the step attribute can be
Use the min attribute together to create a valid value range.
Pattern attributes
The pattern attribute is used to verify the mode of the input field. It is actually a regular expression and does not need to write JavaScript code to bind the regular expression for verification. This is very convenient.
The pattern attribute applies to text, search, url, telephone, email, and password of input.
For example, the input box is defined as "[A-z] {3}", which is A regular expression constraint containing three letters. If the input is invalid, we will see the following results.
Multiple Attributes
The multiple Attribute specifies that multiple values can be selected in the input field.
The multiple Attribute applies to input emails and files. Multiple files can be uploaded at a time.
The above is a new HTML5 tag and function overview introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave a message and the editor will reply to you in time. Thank you very much for your support for the help House website!