Current location - Education and Training Encyclopedia - Education and training - What's the difference between HTML5 and HTML4 in html5 training?
What's the difference between HTML5 and HTML4 in html5 training?
1 The reason for its launch. HTML5

Solve problems on the network:

Low compatibility between Web browsers: HTML, Css and Javascript that can run in one browser cannot run in another browser.

Reason: The specifications of browsers are not uniform and have not been standardized.

Solution: Make the browser's function conform to common standards.

The document structure is not clear enough: the elements in HTML4 cannot clearly express the document structure.

Solution: Add elements related to the structure.

The functions of Web applications are limited: HTMLL4 has little contribution to Web applications, such as not allowing multiple files to be uploaded at the same time.

Solution: provide an API for Web applications.

Grammatical changes of 2.HTML 5.

The content type has not changed.

File extension (html or. Htm) and HTML5 content types (text/html) remain unchanged.

Document type declaration change

HTML4 needs to indicate which version of HTML it is, while HTML5 doesn't, just use.

Specify character encoding changes

html 4:& lt; Meta-requirement Details Details

Data Grid keygen Output Source Menu

The type of input element added.

E-mail: indicates the e-mail address that must be entered.

Url: Indicates the address entered in the text box.

Number: indicates a number.

Range: Represents a numeric range value.

Data selector: indicates the date and time of the calendar.

Abolished elements

Elements that can be replaced by css

Basic fonts, large center fonts, TT u, etc.

No more frames. Frames.

Due to the negative influence of frame frame on the usability of web pages, HTML5 no longer supports the frame frame, but only supports the form of composite pages composed of iframe frames or multiple pages created by the server, and at the same time, the frameset element, frame element and noframes element are abolished.

Elements supported by only some browsers

Other abolished elements

4. New attributes and abolished attributes

New attribute

Form-related properties

Link-related attributes

Other attributes

The nature of abolition

5. Global attributes

The concept of global attributes has been added to HTML5. Global attributes are attributes that can be used for any element.

ContentEditable property

Allows users to edit the contents of an element. The element that uses this attribute must be the element that can get the mouse focus. After clicking the mouse, a caret symbol will be provided to the user, prompting the user that the element is allowed to be edited.

Is a Boolean type that can be set to true, false, or inheritance status. Where true means editable, false means non-editable, and when true or false is not specified, it has the same inheritance status as the parent element.

Design pattern attribute

Used to specify whether the whole page can be edited. When a page is editable, all elements in the page that support the contentEditable attribute will become editable. You can only modify and edit the designMode property in JavaScript scripts. Attribute values can be turned on (editable) or off (uneditable).

Hide attribute

All elements in HTML5 are allowed to use the hidden attribute, similar to the hidden element in the input element. It has a Boolean value and can be set to true (invisible) or false (visible). When the hidden attribute value of an element is true, the browser does not render the element to make it invisible, but the browser creates the content of the element, that is, after the page is loaded, JavaScript scripts are allowed to cancel the attribute value to make the element visible.

Spelling properties

A new attribute provided by two text input boxes, input(type=text) and textarea, mainly checks the spelling and grammar of user input. The property value is Boolean, which can be true or false.

Tableindex property

When clicking the Tab key, traverse the link element or form element in the window or page that can get the focus, and the tableindex indicates which element is accessed.

If the tableindex value is "-1", it means that the element cannot be obtained.