【问题标题】:What happens if I repeat a CSS style in IE?如果我在 IE 中重复一个 CSS 样式会发生什么?
【发布时间】:2011-06-26 20:23:18
【问题描述】:

在 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?

【问题讨论】:

  • 您的理解是正确的,我只是不记得哪个特定版本的 IE 会在这个 CSS 上绊倒。黑客位于/**/
  • 奇怪的是,他们甚至对那些考虑从 IE6 开始支持 jQuery core 的 的人感到困扰...

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


【解决方案1】:

见: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 元素。

【讨论】:

  • 不错的挖掘。这是一些非常老派的过滤。我不认为我曾经使用过这个特定的,即使是在那时。
猜你喜欢
  • 1970-01-01
  • 2012-06-06
  • 2011-05-17
  • 2015-08-30
  • 1970-01-01
  • 2014-03-27
  • 2013-03-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多