1, recommend the use of HTML5 document declaration
- <! DOCTYPE html>
2, must affirm the document encoding charset, and is consistent with the file itself encoding, recommends uses the UTF-8 code
- <meta CharSet="Utf-8">
3, title is indispensable, control in 25 words, 50 bytes or less. "Level Two-level column-site name".
4, keywords is very important, keywords, for SEO.
Note: 5 or so, a single 8 Chinese characters, taboo piling, not related to the site theme.
5, Description website Description, the number of words as far as possible in 80 characters, 160 characters or less
6, the use of raster processing, commonly used 980 grid, 1000 grid
7, write notes, convenient program development nested. Comment Method:
Start Comment:<!--Comment--
End comment:<!--/comment
Allow only start comments
Note: The floating place does not annotate, may cause the layout dislocation or the text bug.
8, img Add alt attribute, increase accessibility.
- src=""alt="Picture description"title="Picture description">
9. An ASCII entity or special character with an entity name is used to use the entity name.
Note: The entity name is case sensitive.
character |
name |
Entity name |
¥ |
RMB symbol: RMB |
¥ |
? |
Copyright |
© |
? |
Registered trademarks |
® |
? |
Trademark TM |
™ |
· |
Interval symbol |
· |
" |
Double quotes |
" |
& |
& Characters |
& |
< |
Left angle bracket (less than sign) |
< |
> |
Right angle bracket (greater than sign) |
> |
|
Half-width space |
|
X |
Multiplication sign |
× |
÷ |
Division Sign |
÷ |
10, the label must be nested correctly, the label must be closed.
11, with Div and other label layout; table-type data, table preferred.
12, the code style uses the tree structure, enhances the readability, avoids the redundant nesting.
13, the module must be kept independent, block layout, easy to delete and modify, many people co-maintenance.
The HTML template is given below:
- <! DOCTYPE html>
- <meta CharSet="Utf-8">
- <meta http-equiv="x-ua-compatible" content="Ie=edge" />
- <meta Name="viewport" content="width=device-width,initial-scale=1, User-scalable=no " />
- <title> website title, controlled within 25 characters, 50 bytes </title>
- <meta Name= "keywords" content="keywords, 5 or so, single 8 kanji">
- <meta Name= "description" content="Site description, the number of words as far as possible empty in 80 kanji, 160 characters or less!" ">
- <!--[If Lt IE 9]>
- <script Type="text/javascript" src="Plug/html5.js"></script >
- <! [endif]-->
- <link href="templates/lfsp/css/lfsp.css" rel="stylesheet" type ="Text/css" />
- <link href="templates/lfsp/css/style.css" rel="stylesheet" Type="Text/css" /><!--own Style--
- <!--[if IE 6]>
- <script type= "Text/javascript" src= "Plug/dd_belatedpng_0.0.8a-min.js" ></script>
- <script>dd_belatedpng.fix ('. Pngfix,.icon ');</script>
- <! [endif]-->
- <body>
- website Header
- <div> Content Section </div>
- <footer> Footer </footer>
- <script Type="text/javascript" src="Plug/jquery.min.js"> </script>
- <script Type="text/javascript" src="Templates/lfsp/lfsp.js" ></script>
- </body>
< reference:http://lfsp.btwlo.com/htmlstructure.html>
HTML Writing Specification