3 HTML
3.1 HTML Style Rules
3.1.1 Document Type(文件类型)
Use HTML5.
HTML5 (HTML syntax) is preferred for all HTML documents: .
HTML5(HTML语法)是所有HTML文档的首选:<!DOCTYPEhtm>。
(建议使用HTML作为文本html。不要使用XHTML。XHTML作为application/xhtml+xml,缺乏浏览器和基础设施支持,提供的优化空间吧HTML小。)
Although fine with HTML, do not close void elements, i.e. write
, not
.
虽然HTML很好,但不要关闭void元素,即写
,而不是
。
3.1.2 HTML Validity(HTML有效性)
Use valid HTML where possible.
尽可能使用有效的HTML。
Use valid HTML code unless that is not possible due to otherwise unattainable performance goals regarding file size.
使用有效的HTML代码,除非这是不可能的,因为否则无法实现有关文件大小的性能目标。
Use tools such as the W3C HTML validator to test.
使用W3CHTML验证码器等工具进行测试。
Using valid HTML is a measurable baseline quality attribute that contributes to learning about technical requirements and constraints, and that ensures proper HTML usage.
使用有效的HTML是一个可测量的基线质量属性,它有助于了解技术需求和约束,并确保适当的HTML使用。