In the writing of HTML, there may be some aspects of the specification, after the "HTML5 coding standard" after learning, the use of code annotations, to do related collation, convenient for future review.
1 <!DOCTYPE HTML> <!--HTML5 DOCTYPE Standard mode declaration, which ensures consistent presentation in every browser -2 <HTMLLang= "ZH-CN"> <!--Language Properties Help the speech synthesis tool determine the pronunciation it should use, and help the translation tool determine the rules it should follow when translating. -3 <Head>4 5 <!--character encoding ensures that the browser can quickly and easily determine how the page content is rendered by explicitly declaring the character encoding -6 <MetaCharSet= "UTF-8">7 8 <!--IE supports the use of specific <meta> tags to determine which version of IE should be used to draw the current page. 9 unless there is a strong special need, it is best to set it to edge mode, which informs IE to use the latest mode it supports. -Ten <Metahttp-equiv= "X-ua-compatible"content= "Ie=edge"> One A <title>Page Title</title> - - <!--External CSS According to the HTML5 specification, it is generally not necessary to specify the type attribute when introducing a CSS file because TEXT/CSS is its default value - the <Linkrel= "stylesheet"href= "Code-guide.css"> - - <!--in-document CSS - - <style> + /* ... */ - </style> + A <!--JavaScript is generally not required to specify the type attribute when introducing a JavaScript file according to the HTML5 specification because Text/javascript is its default value - at <Scriptsrc= "Code-guide.js"></Script> - - </Head> - <Body> - - <!--attribute order HTML attributes should be arranged in the order given below to ensure readability of the code. in class - ID, name to data-* + src, for, type, href - title, Alt the aria-*, role * class is used to identify highly reusable components and should therefore be ranked first. IDs are used to identify specific components and should be used with caution (for example, bookmarks within a page), so the second position - $ <aclass="..."ID="..."Data-modal= "Toggle"href="#">Panax Notoginseng Example Link - </a> the + <inputclass= "Form-control"type= "text"> A the <imgsrc="..."alt="..."> + - <!--Boolean (Boolean) attribute if there is a value, it is true, if there is no value, it is false - $ <Select> $ <optionvalue= "1"selected>1</option> - </Select> - the <!--JavaScript is loaded at the bottom of the body to add Fast page rendering speed - - <Scriptsrc= "Code-guide.js"></Script>Wuyi </Body> the </HTML>
HTML5 Coding Specification