<!DOCTYPE html>是HTML5中唯一的doctype,也被视作将网页“升级”到HTML5的第一步。

很多国外网站的<!DOCTYPE html>和<HEAD>之间都会有一段注释,如:

<!—[if IE 6 ]><html class=“ie ielt9 ielt8 ielt7 ie6” lang=“en-US”><![endif]—>
<!—[if IE 7 ]><html class=“ie ielt9 ielt8 ie7” lang=“en-US”><![endif]—>
<!—[if IE 8 ]><html class=“ie ielt9 ie8” lang=“en-US”><![endif]—>
<!—[if IE 9 ]><html class=“ie ie9” lang=“en-US”><![endif]—>
<!—[if (gt IE 9)|!(IE)]><!—><html lang=“en-US”><!—<![endif]—>

作用于css。来写一些针对IE各版本的样式差异

先判断用户用的哪个IE版本,然后在 标签上加上该版本的class,这样可以方便hack
css文件是这样写的。
.ie6 xxx {};
.ie7 xxx {};
这是目前最好的hack方式之一。

相关文章:

  • 2021-10-19
  • 2021-11-18
  • 2022-02-20
  • 2022-12-23
  • 2021-05-12
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2021-12-31
  • 2021-09-02
  • 2022-02-20
  • 2022-12-23
相关资源
相似解决方案