[关闭]
@heqinglin 2018-03-12T13:28:46.000000Z 字数 2265 阅读 67

网站实现前端规范及注意事项

文档


愿景

不管项目有多少人共同参与,代码都像是同一个人编写的。

html编码规范

  1. <input type="text" disabled readonly>
  2. <video loop muted autoplay></video>
  3. <select>
  4. <option value="" selected></option>
  5. </select>

css编码规范

  1. .header{height:105px; position:fixed; left:0; top:0; width:100%;}
  2. .header .inav{font-size:14px; color:#404040;}
  1. header{}
  1. .sidebar {
  2. /* 位置 */
  3. position: absolute;
  4. top: 50px;
  5. left: 0;
  6. overflow-x: hidden;
  7. /* 尺寸 */
  8. width: 200px;
  9. padding: 5px;
  10. border: 1px solid #ddd;
  11. /* 文本*/
  12. font-size: 14px;
  13. line-height: 20px;
  14. /* 视觉效果 */
  15. background: #f5f5f5;
  16. color: #333;
  17. -webkit-transition: color 1s;
  18. transition: color 1s;
  19. }
  1. /* author: heql
  2. * date: 2018-02-28
  3. */
  1. /*2017-02-16 by heql*/

js编码规范

网站注意事项

一些奇葩的坑

以下都是工作中不易发现的坑,可能踩进去就出不来了,持续补充此类bug,便于大家查找问题,快速解决。

IE的坑

  1. .bg{background:url(../bg.jpg)repeat} //报错

项目启动会

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注