====================================================================== === SimpleBoxes HTML coding guideline ================================ ====================================================================== Written by Takuya Otani / 01 Jun 2007 Copyright (C) 2007 SimpleBoxes/SerendipityNZ All rights reserved. [Revision History] * ver 0.00 [2007/06/01] first edition [Summary] This document defines an HTML coding style. [License] This document is licensed under the Creative Commons Attribution 3.0 Unported: http://creativecommons.org/licenses/by/3.0/ [Comments] - use pairs of "". - do NOT include "-" in comments. - do NOT put "BEGIN" or "END" at the beginning of comments (these words conflict with template format for Serene Bach/Pukeko). [Head element] The elements in a head element will be described as the following sequence. 1. meta elements 2. a title element 5. a base element 3. link elements 4. script elements 6. style elements 7. object elements 8. others * declaration of guideline Include the following link element to indicate an applied guideline. ex) [Attributes] The attributes on elements will be described as the following sequence. 1. prioritized attributes 2. core attributes 3. internationalization attributes 4. attributes for common UI events 5. attributes for elements that can get the focus 6. others * prioritized attributes The sequence of prioritized attributes depends on the element (see "Prioritized attributes"). * core attributes 1. class 2. id 3. title 4. style * internationalization attributes It is the same order as DTD. For example, in XHTML 1.0 strict: 1. lang 2. xml:lang 3. dir * attributes for common UI events It is the same order as DTD. For example, in XHTML 1.0 strict: 1. onclick 2. ondblclick 3. onmousedown 4. onmouseup 5. onmouseover 6. onmousemove 7. onmouseout 8. onkeypress 9. onkeydown 10. onkeyup * attributes for elements that can get the focus It is the same order as DTD. For example, in XHTML 1.0 strict: 1. accesskey 2. tabindex 3. onfocus 4. onblur * others Other attributes mean specific attributes for each element but not prioritized. It will be the same order as DTD. [Prioritized attributes] * meta element 1. http-equiv 2. name 3. content * link element 1. rel 2. rev 3. href 4. type * script element 1. src 2. type * style element 1. type * object element 1. data 2. type 3. classid 4. height 5. width 6. name * param element 1. id 2. name 3. value 4. valuetype 5. type * ins / del element 1. cite 2. datetime * blockquote element 1. cite * table element 1. summary * col / colgroup element 1. span * td / th element 1. abbr 2. rowspan 3. colspan 4. scope * a element 1. href 2. name * img element 1. src 2. alt 3. width 4. height 5. longdesc * map element 1. name * area element 1. href 2. shape 3. coords 4. alt * q element 1. cite * form element 1. action 2. method 3. enctype 4. name * label element 1. for * input element 1. type 2. name 3. value 4. size 5. src 6. alt 7. checked 8. disabled 9. readonly * select element 1. name 2. size 3. multiple 4. disabled * optgroup element 1. label 2. disabled * option element 1. value 2. label 3. selected 4. disabled * textarea element 1. name 2. cols 3. rows 4. disabled 5. readonly * button element 1. type 2. name 3. value 4. disabled * frameset element 1. cols 2. rows * frame / iframe element 1. name 2. src 3. longdesc [Indent] Use tab rather than space. If content of an element is long, the element can be without indent. ex)

long, long, long, long, quite long, long ...(snip)

long, long, long, long, quite long, long ...(snip)

html element, head element, body element should be described without indent. Each element in head element has an indent. The indent level of elements in body element depends on the depth. However these can be described without indent on case-by-case basis. [Linefeeds] Insert linefeeds at the end of end tag as general rule. Each element in head element will be separarted line. [References] - http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd