HTML5 new properties and repealed properties

Source: Internet
Author: User

In HTML5, many attributes are added and abolished at the same time as new additions and abolishment of many elements.

New properties

1. Form-related properties

    • Specifies the Autofocus property for input (Type=text), select, TextArea, and button. It gives the element the focus automatically when the screen is opened, in the way that the property is specified.
    • Specifies the placeholder property for input (Type=text), textarea, which prompts the user for input, prompting the user to enter the content.
    • Specifies the form property 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 the form.
    • Specifies the required property for input (Type=text) and textarea. This property indicates that the user commits a check and checks that the element must have input inside it.
    • Add several new attributes to the input tag: autocomplete, Min, max, multiple, pattern, and step. The list property is used in conjunction with the DataList element, and the DataList element is used in conjunction with the AutoComplete property. The multiple property allows uploading of multiple files at once, and the pattern property is used to validate the mode of the input field, which is actually a regular expression. The Step property specifies the legal number interval for the input field (if step= "3", the legal number should be-3, 0, 3, 6, and so on), the Step property can be used with the Max and Min properties to create a range of legal values.
    • Adds FormAction, Formenctype, FormMethod, formnovalidate, and Formtarget attributes to the input, button element. The user overloads the action, Enctype, method, Novalidate, and target properties of the form element. To add the disabled property to the FIELDSET element, you can set its child elements to disabled state.
    • To add the Novalidate property to input, button, and form, you can cancel the check that is made at the time of submission, and the form can be submitted unconditionally.

2. Link related attributes

    • Add media properties for a and area. Specifies why the target URL is optimized for the type of media/device. This attribute is used to specify that the destination URL is designed for special devices (such as the 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 properties for area. The Hreflang property specifies the language of the text in the document being linked. This property can be used only if 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 be used only when the href attribute is used.
    • Increase the Size property for link. The sizes attribute specifies the size of the linked resource. You can use this property only if the linked resource is an icon (rel= "icon"). This property can accept multiple values. Values are separated by a space.
    • Adding the target property to the base element is primarily to maintain consistency with the a element.

3. Other properties

    • Increase the reversed property for OL, which specifies that the list is displayed in reverse order.
    • Add charset attribute to meta
    • Adds the type and label properties to the menu. Label defines a callout for a courseware for a menu, and the type attribute is only available when the context menu, toolbar, and list are cande but three forms are present.
    • Adds the scoped property to the style. It allows us to define the style for the specified part of the document, rather than the entire document. If you use the "scoped" property, the specified style can only be applied to the parent element of the style element and its child elements.
    • Add or subtract attributes for script, which defines whether the scripts execute asynchronously. The Async property applies only to external scripts (when using the SRC attribute) there are several ways to execute external scripts:
      • If async= "Async": The script executes asynchronously relative to the rest of the page (the script will be executed when the page resumes parsing)
      • If Async is not used and defer= "defer": the script executes when the page finishes parsing
      • If neither async nor defer is used: reads and executes the script immediately before the browser continues to parse the page
    • Add manifest to HTML elements, and when developing an offline Web application, he uses the API to define a URL that describes the cached information for a document at that URL.
    • Add a property to the IFrame, sandbox, seamless, srcdoc. Used to improve page security and prevent untrusted Web pages from performing certain operations.

Revoked Properties

Some of the properties in HTML4 are no longer used in HTML5, but instead are replaced by other attributes or other methods.

Properties that are used in HTML 4

The element that uses the property

Alternative Scenarios in HTML 5

Rev

Link, a

Rel

CharSet

Link, a

Using the HTTP Content-type header element in the linked resource

Shape , Coords

A

Use AREA element instead of a element

Longdesc

IMG, iframe

Link to principal description using a element

Target

Link

Superfluous attribute, omitted

Nohref

Area

Superfluous attribute, omitted

Profile

Head

Superfluous attribute, omitted

Version

Html

Superfluous attribute, omitted

Name

Img

Id

Scheme

Meta

Use scheme only for a single form field

Archive , Chlassid, Codebose, CodeType, declare, standby

Object

Use data with the Typc property class to invoke the plug-in. When you need to use these properties to set parameters, use the Param property

ValueType , type

Param

Use the name with the Value property, not declaring the MIME type

Axis , abbr

TD, Th

Use the form that begins with clear, concise text, followed by detailed text. You can use the Title property for more detail to make the contents of a cell shorter

Scope

Td

Using the HTTP Content-type header element in the linked resource

Align

Caption, input, legend, Div, H1, H2, H3, H4, H5, H6, p

Using CSS style sheets instead

ALink , link, text, vlink, background, bgcolor

Body

Using CSS style sheets instead

Align , bgcolor, border, cellpadding, cellspacing, frame, rules, width

Table

Using CSS style sheets instead

Align , char, charoff, height, nowrap, valign

Tbody, THEAD, TFOOT

Using CSS style sheets instead

Align , bgcolor, char, charoff, height, nowrap, valign, Width

TD, Th

Using CSS style sheets instead

Align , bgcolor, char, Charoff, valign

Tr

Using CSS style sheets instead

Align , Char, Charoff, valign, Width

Col, Colgroup

Using CSS style sheets instead

Align , Border, hspace, Vspace

Object

Using CSS style sheets instead

Clear

Br

Using CSS style sheets instead

Compace , type

OL, UL, Li

Using CSS style sheets instead

Compace

Dl

Using CSS style sheets instead

Compace

Menu

Using CSS style sheets instead

Width

Pre

Using CSS style sheets instead

Align , hspace, Vspace

Img

Using CSS style sheets instead

Align , NoShade, size, Width

hr

Using CSS style sheets instead

Align , frameborder, scrolling, marginheight, Marginwidth

Iframe

Using CSS style sheets instead

Autosubmit

Menu

HTML5 new properties and repealed properties

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.