


A brief overview of the new and abolished attributes of html5_html5 tutorial skills
In HTML5, while many new elements are added and abolished, many attributes are also added and abolished.
New attributes
1. Form-related attributes
Specify the autofocus attribute for input (type=text), select, textarea, and button. It allows the element to automatically gain focus when the screen is opened by specifying attributes. Specify the placeholder attribute for input (type=text) and textarea, which will prompt the user for input and what content the user can input. Specify form attributes for input, output, select, textarea, button, and fieldset. It declares which form it belongs to and then places it anywhere on the page without losing sight of the form. Specify the required attribute for input (type=text) and textarea. This attribute indicates that the user will check when submitting, and check that there must be input content in the element. Add several new attributes to the input tag: autocomplete, min, max, multiple, pattern and step. There is also a list attribute used in conjunction with the datalist element; the datalist element is used in conjunction with the autocomplete attribute. The multiple attribute allows multiple files to be uploaded at one time during upload; the pattern attribute is used to verify the pattern of the input field, which is actually a regular expression. The step attribute specifies the legal number interval of the input field (if step="3", the legal numbers should be -3, 0, 3, 6, and so on). The step attribute can be used in conjunction with the max and min attributes to create legal range of values. Add formaction, formenctype, formmethod, formnovalidate and formtarget attributes to input and button elements. The user overrides the action, enctype, method, novalidate and target attributes of the form element. Add the disabled attribute to the fieldset element to set its child elements to the disabled state. Adding the novalidate attribute to input, button, and form can cancel the relevant checks performed during submission, and the form can be submitted unconditionally.2. Link related attributes
Add media attributes to a and area. Specifies the type of media/device the target URL is optimized for. This attribute is used to specify that the target URL is designed for a particular device (such as iPhone), voice or print media. This property can accept multiple values. Can only be used when the href attribute is present. Add herflang and rel attributes to area. The hreflang attribute specifies the language of the text in the linked document. This attribute can only be used when the href attribute is set. Note: This property is purely advisory. The rel attribute specifies the relationship between the current document and the linked document/resource. The rel attribute can only be used when using the href attribute. Add size attribute to link. The sizes attribute specifies the size of the linked resource. This attribute can only be used when the linked resource is an icon (rel="icon"). This property can accept multiple values. Values are separated by spaces. Adding the target attribute to the base element is mainly to maintain consistency with the a element.3. Other attributes
Add the reversed attribute to ol, which specifies that the list is displayed in reverse order. Add the charset attribute to meta and add type and label attributes to menu. label defines a courseware label for the menu, and the type attribute allows it to appear in three forms: context menu, toolbar, and list. Add scoped attribute to style. It allows us to define styles for specified parts of the document instead of the entire document. If the "scoped" attribute is used, the specified style can only be applied to the parent element of the style element and its children. Add or subtract attributes for script, which defines whether the script is executed asynchronously. The async attribute only works with external scripts (only when using the src attribute). There are several ways to execute external scripts: If async="async": the script executes asynchronously with respect to the rest of the page (while the page continues parsing, the script will be executed) If async is not used and defer="defer": the script will be executed when the page has finished parsing. If neither async nor defer is used: the script is read and executed immediately before the browser continues to parse the page as an html element. Add manifest, which is used in conjunction with the API when developing offline web applications to define a URL and describe the cache information of the document on this URL. Add attributes to iframe, sandbox, seamless, srcdoc. Used to improve page security and prevent untrusted web pages from performing certain operations.Abolished attributes
Some attributes in HTML4 are no longer used in HTML5, but are replaced by other attributes or other methods.
Attributes used in HTML 4 | Elements using this attribute | Alternatives in HTML 5 |
rev | link, a | rel |
charset | link, a | Use the HTTP Content-type header element in the linked resource |
shape, coords | a | Use area element instead of a element |
longdesc | img, iframe | Use the a element to link to the principal description |
target | link | Redundant attributes, omitted |
nohref | area | Redundant attributes, omitted |
profile | head | Redundant attributes, omitted |
version | html | Redundant attributes, omitted |
name | img | id |
scheme | meta | Use scheme only for certain form fields |
archive, chlassid, codebose, codetype, declare, standby | object | Use the data and typc attribute classes to call the plug-in. When you need to use these attributes to set parameters, use the param attribute |
valuetype, type | param | Use name and value attributes, do not declare the MIME type |
axis, abbr | td、th | Use a format that begins with clear, concise text, followed by detailed text.You can use the title attribute for more detailed content to make the cell content shorter |
scope | td | Use the HTTP Content-type header element in the linked resource |
align | caption, input, legend, div, h1, h2, h3, h4, h5, h6, p | Use CSS stylesheet instead |
alink, link, text, vlink, background, bgcolor | body | Use CSS stylesheet instead |
align, bgcolor, border, cellpadding, cellspacing, frame, rules, width | table | Use CSS stylesheet instead |
align, char, charoff, height, nowrap, valign | tbody, thead, tfoot | Use CSS stylesheet instead |
align, bgcolor, char, charoff, height, nowrap, valign, width | td、th | Use CSS stylesheet instead |
align, bgcolor, char, charoff, valign | tr | Use CSS stylesheet instead |
align, char, charoff, valign, width | col, colgroup | Use CSS stylesheet instead |
align, border, hspace, vspace | object | Use CSS stylesheet instead |
clear | br | Use CSS stylesheet instead |
compace, type | ol, ul, li | Use CSS stylesheet instead |
compace | dl | Use CSS stylesheet instead |
compace | menu | Use CSS stylesheet instead |
width | pre | Use CSS stylesheet instead |
align, hspace, vspace | img | Use CSS stylesheet instead |
align, noshade, size, width | hr | Use CSS stylesheet instead |
align, frameborder, scrolling, marginheight, marginwidth | iframe | Use CSS stylesheet instead |
autosubmit | menu |

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











Best practices for H5 code include: 1. Use correct DOCTYPE declarations and character encoding; 2. Use semantic tags; 3. Reduce HTTP requests; 4. Use asynchronous loading; 5. Optimize images. These practices can improve the efficiency, maintainability and user experience of web pages.

Web standards and technologies have evolved from HTML4, CSS2 and simple JavaScript to date and have undergone significant developments. 1) HTML5 introduces APIs such as Canvas and WebStorage, which enhances the complexity and interactivity of web applications. 2) CSS3 adds animation and transition functions to make the page more effective. 3) JavaScript improves development efficiency and code readability through modern syntax of Node.js and ES6, such as arrow functions and classes. These changes have promoted the development of performance optimization and best practices of web applications.

H5 is not just the abbreviation of HTML5, it represents a wider modern web development technology ecosystem: 1. H5 includes HTML5, CSS3, JavaScript and related APIs and technologies; 2. It provides a richer, interactive and smooth user experience, and can run seamlessly on multiple devices; 3. Using the H5 technology stack, you can create responsive web pages and complex interactive functions.

H5 and HTML5 refer to the same thing, namely HTML5. HTML5 is the fifth version of HTML, bringing new features such as semantic tags, multimedia support, canvas and graphics, offline storage and local storage, improving the expressiveness and interactivity of web pages.

HTML5 is a key technology for building modern web pages, providing many new elements and features. 1. HTML5 introduces semantic elements such as, , etc., which enhances web page structure and SEO. 2. Support multimedia elements and embed media without plug-ins. 3. Forms enhance new input types and verification properties, simplifying the verification process. 4. Offer offline and local storage functions to improve web page performance and user experience.

HTML5 code consists of tags, elements and attributes: 1. The tag defines the content type and is surrounded by angle brackets, such as. 2. Elements are composed of start tags, contents and end tags, such as contents. 3. Attributes define key-value pairs in the start tag, enhance functions, such as. These are the basic units for building web structure.

H5 improves web user experience with multimedia support, offline storage and performance optimization. 1) Multimedia support: H5 and elements simplify development and improve user experience. 2) Offline storage: WebStorage and IndexedDB allow offline use to improve the experience. 3) Performance optimization: WebWorkers and elements optimize performance to reduce bandwidth consumption.

Key elements of HTML5 include,,,,,, etc., which are used to build modern web pages. 1. Define the head content, 2. Used to navigate the link, 3. Represent the content of independent articles, 4. Organize the page content, 5. Display the sidebar content, 6. Define the footer, these elements enhance the structure and functionality of the web page.
