internet explorer 8 ignores width for 'display: table-cell' element

后端 未结 5 2239
耶瑟儿~
耶瑟儿~ 2020-12-03 07:56

According to quirks mode, internet explorer 8 does support table options for display property, but in this example it exhibits very strange behaviour
http://jsfiddle.net

5条回答
  •  甜味超标
    2020-12-03 08:41

    After adding the bounty, I ended up working around this problem by targeting my CSS to IE8. I was already using Paul Irish's technique of adding classes to the element using conditional comments:

    
    
    
    
      
    

    So all I had to do is add an extra CSS rule for IE 8 and lower:

    .img-container { display: table-cell; }   /* IE9+ and other browsers */
    .ielt9 .img-container { display: block; } /* IE8 and lower */
    

    Coupled with the techniques for vertically centring images, this gives me a nice cross-browser solution.

提交回复
热议问题