What are the new features of html5? Summary of new features of html5
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.
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3c3c3;">Your browser does not support the canvas element.</canvas>
<script type="text/javascript"> var c=document.getElementById("myCanvas"); var cxt=c.getContext("2d"); var img=new Image() img.src="/i/eg_flower.png" cxt.drawImage(img,0,0); </script>
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.
For more information about canvas and svg, please refer to: HTML5 canvas and HTML5 inline SVG
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:
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 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 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 element.
3. HTML5 new features: video and audio elements for media
1. HTML5 provides a standard for playing audio files, that is, using the
##Example:
Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.
