Skip to content

Instantly share code, notes, and snippets.

@hjzheng
Created June 23, 2014 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hjzheng/e3a1fadb3ef7df69ecef to your computer and use it in GitHub Desktop.
Save hjzheng/e3a1fadb3ef7df69ecef to your computer and use it in GitHub Desktop.
HTML编码规范
1、所有书写均在英文半角状态下的小写;
2、id,class必须以字母开头;
3、所有标签必须闭合;
4、html标签用tab键缩进;
5、属性值必须带引号;
6、<!-- html注释 -->
7、/* css注释 */
8、ul,li/ol,li/dl,dt,dd拥有父子级关系的标签;
9、p,dt,h标签 里面不能嵌套块属性标签;
10、a标签不能嵌套a;
11、内联元素不能嵌套块;
Copy link

ghost commented Aug 11, 2016

为什么所有标签必须闭合?我看到这样的描述

In XHTML (an XML schema that implements HTML elements), you'd often put a forward slash before the final angle bracket to indicate the ending of an empty element.
原文链接

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment