Home >
Article > Web Front-end > What are the new features of html5? Summary of new features of html5
What are the new features of html5? Summary of new features of html5
不言Original
2018-08-31 15:42:227900browse
We all know that html5 is the fifth major modification of html. So, since it is a major modification, there will definitely be new features. So, What are the new features of html5? The following article will summarize the new features of html5.
First of all, we should all know what html5 means. If you don’t know much about html5, then you can take a look at this article: What is html5? What is the use of html5? , okay, after knowing the specific definition of html5, let's take a look at the new features of html5.
What are the new features of html5?
1. The new features of HTML5: canvas element for painting
The canvas element is used to draw graphics on the web page. The canvas is a rectangle area, you can control every pixel of it. canvas has many ways to draw paths, rectangles, circles, characters, and add images.
Let’s talk about the content of svg: svg is a graphics format used to describe two-dimensional vector graphics.
There are three ways to use svg:
Put svg directly as a picture on the web page.
svg realizes animation.
Interaction and filter effects of svg images.
Instructions:
(1) Canvas draws 2D graphics through JavaScript.
(2) Canvas is rendered pixel by pixel.
(3) In canvas, once the graphic is drawn, it will no longer receive the attention of the browser. If its position changes, the entire scene needs to be redrawn, including any objects that may have been covered by graphics.
(4) svg is a language that uses XML to describe 2D graphics.
(5) svg is based on XML, which means that every element in the SVG DOM is available. You can attach a JavaScript event handler to an element.
(6) In svg, each drawn graphic is considered an object. If the properties of the svg object change, the browser can automatically reproduce the graphic.
2. The new features of html5 are richer and more powerful forms
html5 has multiple new form input types. These new features provide better input control and validation.
html5 also adds the following form elements:
fc86e7b705049fc9d4fccc89a2e80ee3: The element specifies the option list of the input field, using the list attribute of the d5fd7aea971a85678ba271703566ebfd element and the id of the fc86e7b705049fc9d4fccc89a2e80ee3 element Binding.
aa983b9eb8086376f1f6481364a02e5a: Provides a reliable way to authenticate the user, the tag specifies the key pair generator field to be used in the form.
be6d67dae90cc1ad6469079e163d0939: Used for different types of output, such as calculation or script output.
HTML5 New form attributes:
placehoder attribute: A short prompt will be displayed on the input field before the user enters the value. That is, our common default prompt of the input box disappears after the user inputs.
required attribute: It is a boolean attribute. The input field required to be filled in cannot be empty
pattern attribute: describes a regular expression used to verify the value of the d5fd7aea971a85678ba271703566ebfd element.
min and max attributes: Set the minimum and maximum values of the element.
step attribute: Specifies the legal number interval for the input field.
Height and width attributes: Image height and width for d5fd7aea971a85678ba271703566ebfd tags of type image.
autofocus attribute: is a boolean attribute. Specifies that the field automatically gains focus when the page loads.
multiple attribute: It is a boolean attribute. Specifies that multiple values can be selected within the d5fd7aea971a85678ba271703566ebfd element.
3. HTML5 new features: video and audio elements for media
1. HTML5 provides a standard for playing audio files, that is, using the b97864c2e0ef2353a16c4d64c7734e92 element
##Example: 18dbbd863b2f3ec472f4bf0ef643e619
您的浏览器不支持 audio 元素。
Description:
(1)control Properties for adding play, pause, and volume controls. (2) Between b97864c2e0ef2353a16c4d64c7734e92 and 81d2bc32cafa2076a27f10cdd878d0ab you need to insert the prompt text of the b97864c2e0ef2353a16c4d64c7734e92 element that the browser does not support. (3) The b97864c2e0ef2353a16c4d64c7734e92 element allows the use of multiple e02da388656c3265154666b7c71a8ddc elements. The e02da388656c3265154666b7c71a8ddc element can link different audio files, and the browser will use the first supported audio file. (4) The b97864c2e0ef2353a16c4d64c7734e92 element supports three audio format files: MP3, Wav, and Ogg.
2. HTML5 provides a standard way to include videos through the video element.
Description:
(1) control provides play, pause and volume controls to control the video. You can also use DOM operations to control the playback and pause of the video, such as the play() and pause() methods.
The above is the detailed content of What are the new features of html5? Summary of new features of html5. For more information, please follow other related articles on the PHP Chinese 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