如何在Internet Explorer中使用表格单元 [英] how to use table-cell in Internet explorer

查看:64
本文介绍了如何在Internet Explorer中使用表格单元的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...我想问一下,为什么属性表格单元无法正常工作并且在中间未垂直对齐?
现在我有这个结构,我希望这个结构的图像居中对齐...它可以在其他浏览器中正常工作,但是当它不起作用时,就是我的html的结构...

Hi guys... I would like to ask why is it that the property table-cell is not working properly and not aligning vertically in the middle?
right now i have this structure and i want the images for this structure to be align center... it working in other browser properly but when it comes to ie its not working here is the structure for my html...

<div id="logos">
   <ul>
      <li><img src="image1.jpg" /></li>
      <li><img src="image2.jpg" /></li>
   </ul>

</div>



所以我希望图像在中间垂直对齐(假设image2的高度大于image1的高度.假设image2的高度为100px,image2的高度为40px)

这是我的CSS样式



so i want the images to be vertically aligned in the middle (assuming image2 has a bigger height than image1. assuming image2 has a height of 100px and image2 has a height of 40px)

and here is my css styling for this

#logos ul{
  display: table;
  height: 100px;
  margin: 0;
  padding: 0;
  text-align: center;
}
#logos ul li{
  display: table-cell;
  list-style: none outside none;
  padding-right: 15px;
  text-align: center;
  vertical-align: middle;

}


我在除IE及其工作以外的其他浏览器上对此进行了测试,但是当谈到IE时,我感到非常沮丧...我似乎无法使表格单元属性正常工作...任何帮助都将是个好人...谢谢


i tested this on other browser other than IE and its working but im so frustrated when it comes to IE... i cant seem to make table-cell property work properly... any help will be great guys... thanks

推荐答案

由于您知道表的大小(700),因此可以通过在第二行中设置两个单元格的宽度来解决该错误.在第二个单元格设置为600 px的情况下,该表格将正常运行.

但是,这可能是一个规范错误,因为所有细节似乎都含糊不清. CSS 3中的算法看起来更加仔细地指定了.
Since you know the size of the table (700) you can work around the bug by setting the width of both cells in the second row. With the second cell set to 600 px, the table behaves.

However, this is probably a spec bug, since it all seems very vague about many details. The algorithm in CSS 3 looks much more carefully specified.


这篇关于如何在Internet Explorer中使用表格单元的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆