How to get display:table-cell support in IE? any p

2020-02-06 04:02发布

How to get display:table-cell support in IE? I need lightest solution.

3条回答
对你真心纯属浪费
2楼-- · 2020-02-06 04:41

No versions of Internet Explorer (including IE8) support the property values "inline-table", "run-in", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-row", or "table-row-group".

This is the note from w3schools

I think you should try another way.

查看更多
Explosion°爆炸
3楼-- · 2020-02-06 04:52

the fastest (but not clean) solution is to wrap your container by a table inside a conditional comment like so

<!--[if lte IE 7 ]><table><td><![endif]-->
<div>                   
 <!-- your markup here -->
</div>
<!--[if lte IE 7 ]></td></table><![endif]--> 

Could be acceptable for a single page, but definitely to avoid in a large scale

otherwise you could specify in detail why are you trying to define a display: table-cell. if this is somewhat related to obtain a vertical alignment of text you could take a look to this snippet of code

http://jsfiddle.net/fcalderan/985e4/

-- edit (after comment)

If you wish to obtain a bottom alignment you could also set position : relative to the image container and then position: absolute; bottom: 0; to the image

-- edit 2 (after comment)

We are still waiting your code. Anyway the resulting css will be

#imagecontainer {   /* or whatever image container you have */
  position: relative;
}

#imagecontainer img {
  position: absolute;
  bottom : 0;
  left: 50%; 
  margin-left:-n/2px; /* where 'n' is width of your image */
}
查看更多
爷的心禁止访问
4楼-- · 2020-02-06 04:55

Probably if you look at the test site, which use display: table-cell in different combinations, you can easier choose the CSS settings which you need?

查看更多
登录 后发表回答