zoukankan      html  css  js  c++  java
  • 针对firefox ie6 ie7 ie8的css样式hack (转载)

    详细出处参考:http://www.jb51.net/css/15987.html

    今天做tab切换的时候,遇到问题,ie8,ie7,firefox对px高度的解析不统一,开始的时候打算
    !important 解决之,后来发现ie7,ie8都支持这个了。根本无法判断。于是在网上找到一篇文章。

    针对firefox ie6 ie7 ie8的css样式hack 以前我们大部分都是用!important来hack,对于ie6和firefox测试可以正常显示,但是ie7以上对!important可以正确解释,会导致页面没按要求显示!搜索了一下,找到了一个针对IE7、IE8不错的hack方式,IE7使用*+html或*line-height: 23px

    针对firefox ie6 ie7 ie8的css样式hack
    以前我们大部分都是用!important来hack,对于ie6和firefox测试可以正常显示,但是ie7以上对!important可以正确解释,会导致页面没按要求显示!搜索了一下,找到了一个针对IE7、IE8不错的hack方式,IE7使用*+html或*line-height: 23px,IE8使用“\9”来区分,比如:line-height: 26px\9。

    CSS可以参照如下定义,注意顺序:
    #menu { line-height: 23px; }/* firefox 浏览器实行这句定义 */
    #menu { line-height: 26px\9; }/*ie6,ie7,ie8 这句定义主要尖对IE8来hack*/
    #menu { *line-height: 23px; }/*ie6,ie7 这句定义主要尖对IE7来hack*/
    #menu { _line-height: 23px; }/*ie6 浏览器优先实行这句定义*/ 或者写成一句

    #menu { line-height:23px; line-height: 26px\9; *line-height: 23px; _line-height:23px; } 或者

    * html #menu { line-height: 23px; } /* IE6 浏览器实行这句定义 */
    *+html #menu { line-height: 23px; }/* IE7 浏览器实行这句定义*/

    详细出处参考:http://www.jb51.net/css/15987.html



  • 相关阅读:
    Leetcode Unique Binary Search Trees
    Leetcode Decode Ways
    Leetcode Range Sum Query 2D
    Leetcode Range Sum Query
    Leetcode Swap Nodes in Pairs
    Leetcode Rotate Image
    Leetcode Game of Life
    Leetcode Set Matrix Zeroes
    Leetcode Linked List Cycle II
    CF1321A
  • 原文地址:https://www.cnblogs.com/zsbfree/p/1837665.html
Copyright © 2011-2022 走看看