一、验证代码是否符合标准

优点:

  •   标准的页面会保证浏览器正确的渲染
  •   网页能更容易被搜索引擎搜索,提高网站的搜索排名
  •   提高网站的易用性
  •    网页更好维护和扩展

常用工具:

  • W3 Validator
  • HTML Validator(Firefox)

二、常用规范

自闭合标签:area  base br col command embed hr img input keygrn link meta param source track wbr

过时标签不再使用:basefont  big  center font 

不推荐在HTML标签中添加样式属性

移除不常用的HTML标签:acronym applet dir

样式与结构分离

设置IE浏览器兼容:<meta http-equiv="X-UA-Compatible" content="IE=8"/>

设置页面中移动设备的显示:<meta name="viewpoint" content="width=device-width,initial-scale=1,maximum-scale=1"/>

 

相关文章:

  • 2021-10-16
  • 2022-01-31
  • 2021-11-02
  • 2021-06-23
  • 2021-09-25
  • 2021-11-08
  • 2022-01-13
猜你喜欢
  • 2022-12-23
  • 2022-01-21
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案