如果我在IE中重复CSS样式会发生什么?

时间:2011-02-14 10:49:43

标签: css internet-explorer internet-explorer-6 internet-explorer-5

在jquery-ui-1.8.6.custom.css中,我找到了这个gem:

/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
    display: none; /*sorry for IE5*/
    display/**/: block; /*sorry for IE5*/
    position: absolute; /*must have*/
    ...
}

显然,重复display样式是IE中的错误的解决方法。如果我正确理解CSS,它应该像display: block;一样(即第一个条目应该被第二个覆盖)。

IE的哪个版本是必要的?只有5.x或6?

1 个答案:

答案 0 :(得分:3)

请参阅:http://www.communis.co.uk/dithered/css_filters/css_only/property_empty_comment.html

#testElement {
   color/**/: #00cc00;
   }
  

应用
  ..
  赢得IE 5.5 - 6.x
  ..

     

未应用
  赢得IE 4.0 - 5.0
  ..

因此,评论/*sorry for IE5*/恰当地描述了黑客 - 仍然存在的零IE5.0用户将无法看到任何.ui-datepicker-cover元素。