Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the standard code format for Htlm

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "what is the standard code format of Htlm", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "what is the standard code format of Htlm" article.

1. The document type uses the html5 standard document type.

The lang attribute is specified on the 2.html element a. Display the page language, help the language synthesis tool to determine how to pronounce it, and the rules that the translation tool determines to use, and so on.

3. Specifies an explicit character encoding. Let the browser easily and quickly determine the rendering method suitable for web content.

4.IE compatibility mode. Internet Explorer supports the use of compatibility tags to specify which version of IE to use to render pages. If it is not a special need, it is usually through edge mode to inform IE to use the latest compatibility mode.

The order of 5.head parts: a. Element, b. The required js file (eg. Moddernizr or HTML5 Shiv, c. Element, d. Style sheet.

6. You can use IE conditional annotations to be compatible with IE, but do not add additional stylesheets.

7. Now dual-core browsers: 360, Sogou, QQ and other browsers can make web pages render using webkit kernel by default, the code is as follows.

Attribute

1. Double quotation mark attribute value, do not use single quotation marks.

two。 Omit the type attribute. With style, link, and script, you don't have to specify the type attribute, because text/css and text/javascript are their default values, respectively.

3. Omit the value of the Boolean property. The Boolean attribute does not need to add values, disabled,checked,selected, and so on.

4. Omit the url class attribute resource protocol header.

5. Attribute order. The html attribute should appear in a specific order to ensure readability. Class- > id,name- > data-*- > src,for,type,href- > title,alt- > aria-*,role.

6. Multimedia elements add alternate attributes. Alt attribute is added to the image, and alternative text is added to the audio and video.

7. Do not set the tabindex property manually, let the browser set it automatically.

element

1. Avoid redundant tags.

two。 Avoid JS generating tags.

3. Paragraph text should be used

To avoid using the

.

4. List items put, do not use a series of or

5. Bind using the for property.

6. Wrap radio or checkbox and their text with tags instead of using the for attribute

7. Use radio and check to replace the drop-down menu. (radio or checkbox instead of select menu)

8.form button should define the type type, using type= "submit", type= "reset" or type= "button".

9. The first form button appears first (in DOM), especially if there are multiple submit buttons. The order displayed in the view can be modified using css.

10. Valid use of, (scope property). You can increase the loading speed before putting it.

The above is the content of this article on "what is the standard code format of Htlm". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report