In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what the new and abolished attributes of html5 are, I believe most people don't know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. Let's learn about it together.
In HTML5, while adding and abolishing many elements, many attributes are also added and abolished.
New properties
1. Form-related properties specify autofocus attributes for input (type=text), select, textarea, and button. It automatically gives the element focus when the screen is opened by specifying attributes. Specify the placeholder attribute for input (type=text) and textarea, which prompts the user for input and prompts for what the user can enter. Specify the form attribute for input, output, select, textarea, button, and fieldset. It declares which form it belongs to and places it anywhere on the page without losing it within the form. Specify the required attribute for input (type=text) and textarea. This attribute indicates that when the user submits, it is checked that there must be input in the element. Add several new attributes to the input tag: autocomplete, min, max, multiple, pattern, and step. There is also the list attribute used with the datalist element, and the datalist element with the autocomplete attribute. The multiple attribute allows multiple files to be uploaded at a time; the pattern attribute is used to validate 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 number should be-3, 0, 3, 6, and so on), and the step attribute can be used with the max and min properties to create a range of legal values. Add formaction, formenctype, formmethod, formnovalidate and formtarget attributes to the input and button elements. The user overloads the action, enctype, method, novalidate, and target attributes of the form element. By adding a disabled attribute to the fieldset element, you can set its child elements to the disabled state. Add the novalidate attribute to input, button, and form to cancel the check on submission, and the form can be submitted unconditionally.
2. Link related attributes add media attributes to an and area. Specify what type of media / devices the target URL is optimized for. This attribute is used to specify that the target URL is designed for special devices (such as iPhone), voice, or print media. This property can accept multiple values. Can only be used when the href property exists. Add herflang and rel attributes to area. The hreflang attribute specifies the language of the text in the linked document. This property can be used only if the href property is set. Note: this attribute is purely advisory. The rel attribute specifies the relationship between the current document and the linked document / resource. The rel property can only be used when the href property is used. Add the size attribute to link. The sizes attribute specifies the size of the linked resource. This property can be used only if the linked resource is an icon (rel= "icon"). This property can accept multiple values. Values are separated by spaces. Add the target attribute to the base element, mainly to maintain consistency with the an element.
3. Other attributes add the reversed attribute to ol, which specifies that the list is displayed in reverse order. Add charset attributes for meta and type and label attributes for menu. Label defines a courseware annotation for the menu, and the type attribute allows the talent to appear in three forms: context menu, toolbar and list cande. Add the scoped attribute to style. It allows us to define styles for a specified part of the document, rather than the entire document. If you use the "scoped" attribute, the specified style can only be applied to the parent element of the style element and its children. Adds or subtracts attributes to script, which defines whether the script executes asynchronously. The async attribute applies only to external scripts (only 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 (when the page continues to parse, the script will be executed) if not using async and defer= "defer": the script will be executed when the page finishes parsing if neither async nor defer is used: before the browser continues to parse the page Immediately read and execute the script to add manifest to the html element, and he uses it in conjunction with API when developing offline web applications to define a URL that describes the document's cache information on this URL. Add attributes to iframe: sandbox, seamless, srcdoc. Used to improve page security and prevent untrusted web pages from performing certain actions.
The attribute of abrogation
Some attributes in HTML4 are no longer used in HTML5, but are replaced by other attributes or in other ways.
An alternative to an element that uses that attribute in HTML 5 for an attribute used in HTML 4
Rev link 、 a rel
Charset link, a uses HTTP Content-type header elements in linked resources
Shape, coords a use area element instead of an element
Longdesc img and iframe use the an element to link to the principal description
Target link redundant attribute, omitted
Nohref area redundant attribute, omitted
Profile head redundant attribute, omitted
Version html redundant attribute, omitted
Name img id
Scheme meta uses scheme only for a form field
Archive, chlassid, codebose, codetype, declare, and standby object use the data and typc attribute classes to invoke the plug-in. When you need to use these properties to set parameters, use the param property
Valuetype and type param use the name and value attributes and do not declare the MIME type
Axis, abbr td, and th are used in the form of clear and concise text followed by detailed text. You can use the title property for more details to make the contents of the cell shorter
Scope td uses the HTTP Content-type header element in the linked resource
Align caption, input, legend, div, H2, h3, h4, h5, h6, h7, 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 uses CSS stylesheets instead
Compace, type ol, ul, li use CSS stylesheet instead
Compace dl uses CSS stylesheets instead
Compace menu uses CSS stylesheets instead
Width pre uses CSS stylesheets 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
These are all the contents of this article entitled "what are the new and abolished attributes of html5?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.