[Front-end] #001 coding specification,
HTML encoding style:
Document Type:HTML5 type
<!doctype html>
Encoding:Set the encoding type UTF-8 using meta
<!doctype html>
<metacharset="utf-8">
<body>
</body>
Case sensitivity:Except for the Text CDATA element, lowercase is used for all other elements.
Indent:The entire file should be unified (depending on the situation, use 2 or 4 spaces)
Line feed: displays block-level elements (div, p), list elements (ul, ol), table elements (table) line feed, line feed of line elements greater than 80
Programming style
<! -- Not recommended->
<linkrel="stylesheet"href="//www.google.com/css/maia.css"type="text/css">
<! -- Recommendation->
<linkrel="stylesheet"href="//www.google.com/css/maia.css">
<! -- Not recommended->
<scriptsrc="//www.google.com/js/gweb/analytics/autotrack.js"type="text/javascript"></script>
<! -- Recommendation->
<scriptsrc="//www.google.com/js/gweb/analytics/autotrack.js"></script>
6. The button label is preferred, instead of the <input type = "button" title = "button"/>
7. The title attribute must be set for html tags.
CSS development specifications
/* Not recommended */h3 {font-weight: bold ;}
/* Recommended */h3 {font-weight: bold ;}
/* Not recommended */a: focus, a: active {position: relative; top: 1px;}/* Recommended */h1, h2, h3 {font-weight: normal; line-height: 1.2 ;}
Writing Sequence
Css should be written in the following order, in principle:Positioning layout first, followed by details
Z-index usage Specification
In principle, the use of the module css must follow the following rules, but it is not enforced. In the development process, you should use the layout manager to manage the layout.