search
HomeWeb Front-endH5 TutorialA 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
Statement
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
Understanding H5 Code: The Fundamentals of HTML5Understanding H5 Code: The Fundamentals of HTML5Apr 17, 2025 am 12:08 AM

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.

H5 Code: Best Practices for Web DevelopersH5 Code: Best Practices for Web DevelopersApr 16, 2025 am 12:14 AM

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.

H5: The Evolution of Web Standards and TechnologiesH5: The Evolution of Web Standards and TechnologiesApr 15, 2025 am 12:12 AM

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.

Is H5 a Shorthand for HTML5? Exploring the DetailsIs H5 a Shorthand for HTML5? Exploring the DetailsApr 14, 2025 am 12:05 AM

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: Commonly Used Terms in Web DevelopmentH5 and HTML5: Commonly Used Terms in Web DevelopmentApr 13, 2025 am 12:01 AM

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.

What Does H5 Refer To? Exploring the ContextWhat Does H5 Refer To? Exploring the ContextApr 12, 2025 am 12:03 AM

H5referstoHTML5,apivotaltechnologyinwebdevelopment.1)HTML5introducesnewelementsandAPIsforrich,dynamicwebapplications.2)Itsupportsmultimediawithoutplugins,enhancinguserexperienceacrossdevices.3)SemanticelementsimprovecontentstructureandSEO.4)H5'srespo

H5: Tools, Frameworks, and Best PracticesH5: Tools, Frameworks, and Best PracticesApr 11, 2025 am 12:11 AM

The tools and frameworks that need to be mastered in H5 development include Vue.js, React and Webpack. 1.Vue.js is suitable for building user interfaces and supports component development. 2.React optimizes page rendering through virtual DOM, suitable for complex applications. 3.Webpack is used for module packaging and optimize resource loading.

The Legacy of HTML5: Understanding H5 in the PresentThe Legacy of HTML5: Understanding H5 in the PresentApr 10, 2025 am 09:28 AM

HTML5hassignificantlytransformedwebdevelopmentbyintroducingsemanticelements,enhancingmultimediasupport,andimprovingperformance.1)ItmadewebsitesmoreaccessibleandSEO-friendlywithsemanticelementslike,,and.2)HTML5introducednativeandtags,eliminatingthenee

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment