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

本文介绍了谷歌2020年HTML和CSS编码规范,包括使用HTTPS加载资源、遵循2个空格的缩进规则、全小写编码、删除尾部空白、使用UTF-8无BOM编码以及注释的编写方式等,旨在提高代码质量和可读性。
摘要由CSDN通过智能技术生成

1、Protocol(协议)
Use HTTPS for embedded resources where possible.
在可能的情况下,将HTTPS用于嵌入式资源。
Always use HTTPS (https:) for images and other media files, style sheets, and scripts, unless the respective files are not available over HTTPS.
对于图像和其他媒体文件、样式表和脚本,始终使用HTTPS(https:),除非各自的文件在HTTPS上不可用。

2、eneral Formatting Rules(通用格式规则)
2.1 Indentation(行首缩进)
Indent by 2 spaces at a time.
每次缩进两个空格。
Don’t use tabs or mix tabs and spaces for indentation.
不要使用制表符或混合制表符和空格进行缩进。

2.2 Capitalization(资本化)
Use only lowercase.
只使用小写。
All code has to be lowercase: This applies to HTML element names, attributes, attribute values (unless text/CDATA), CSS selectors, properties, and property values (with the exception of strings).
所有代码都必须是小写:这适用于HTML元素名称、属性、属性值(除非文本/CDATA)、CSS选择器、属性和属性值

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值