-
Notifications
You must be signed in to change notification settings - Fork 117
Dev.Coding Standard HTML
Taiwen Jiang edited this page Jul 13, 2013
·
13 revisions
- Refer to Google HTML/CSS Coding Standard for details.
- Use HTML 5: HTML5 (HTML syntax) is preferred for all HTML documents
<!DOCTYPE html>
. ?
Selected rules
- Omit the protocol from embedded resources:
<script src="//www.google.com/js/gweb/analytics/autotrack.js"></script>
? - Indent by 2 spaces at a time. ?
- Use only lowercase for HTML/CSS element names/attributes/values (unless text/CDATA):
color: #e5e5e5;
? - Do not close void elements, i.e. write
<br>
, not<br />
. ? - Do not omit optional tags: It is optionally suggested to omit optional tags in Google guide, for compliance considerations we don't implement this rule.?
- Omit type attributes for style sheets and scripts. ?
- Use a new line for every block, list, or table element. ?
- Use double ("") rather than single quotation marks ('') around attribute values. ?