7 注释
【建议】对超过10行的页面模块进行注释, 以降低开发人员的嵌套成本和后期的维护成本。建议使用结尾注释方式,例如:
当模块代码量较少时,可以省略 start。
<!-- 文章内容 start --><section id="post">do some things...</section><!-- 文章内容 end -->
或者标注模块的class或者id:
<!-- # post start --><section id="post">do some things...</section><!-- # post end -->
[⬆]
参考资料:
- bootcss编码规范
- Google HTML编码规范
- spec HTML编码规范
