google HTML和CSS 2020版编码规范翻译(二)

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使用。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值