2007-04-30

voice-family: "\"}\"";的作用

关键字: voice-family: "\"}\"";, voice-family,IE5x

作为针对IE5x的一种hack,使用实例如下:

css 代码
 
  1. #centercontent {  
  2.   
  3.               background:#fff;  
  4.   
  5.               margin-left199px;  
  6.   
  7.               margin-right:199px;  
  8.   
  9.               border:1px solid #000;  
  10.   
  11.               voice-family"\"}\"";  
  12.   
  13.               voice-family: inherit;  
  14.   
  15.               margin-left201px;  
  16.   
  17.               margin-right:201px;  
  18.   
  19.               }  

              IE5x PC mis-implements the box model. Because of that we sometimes have

              to perform a little CSS trickery to get pixel-perfect display across browsers.

              The following bit of code was proposed by Tantek Celik, and it preys upon a CSS

              parsing bug in IE5x PC that will prematurly close a style rule when it runs

              into the string "\"}\"". After that string appears in a rule, then, we can override

              previously set attribute values and only browsers without the parse bug will

              recognize the new values. So any of the name-value pairs above this comment

              that we need to override for browsers with correct box-model implementations

              will be listed below.

             

              We use the voice-family property because it is likely to be used very infrequently,

              and where it is used it will be set on the body tag. So the second voice-family value

              of "inherit" will override our bogus "\"}\"" value and allow the proper value to

              cascade down from the body tag.

 

              The style rule immediately following this rule offers another chance for CSS2

              aware browsers to pick up the values meant for correct box-model implementations.

              It uses a CSS2 selector that will be ignored by IE5x PC.

             

              Read more at http://www.glish.com/css/hacks.asp

 

             

  

评论
发表评论

您还没有登录,请登录后发表评论

tiger.passion
搜索本博客
我的相册
636a5d3f-1fce-3bb9-89d8-b13e5c6318d4-thumb
w3c01
共 46 张
存档
最新评论