IE9浮动溢出:隐藏和表格宽度100%不正确显示 [英] IE9 Float with Overflow:Hidden and Table Width 100% Not Displaying Properly

查看:297
本文介绍了IE9浮动溢出:隐藏和表格宽度100%不正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在页面的右侧浮动一个容器。在它的左边是很多表,我需要是100%的宽度。我想让他们一直延伸到右边的浮动元素。当右边的那个元素结束时,我希望表格扩展到页面的末尾。

I am trying to float a container on the right hand side of the page. To the left of it are a lot of tables that I need to be 100% width. I want them to go extend all the way to the floating element on the right. When that element on the right ends I want the tables to extend to the end of the page.

这在IE以外的每个浏览器都很好用。在IE中,所有表都显示在右侧的浮动元素下面。我知道在IE中有一个溢出隐藏的解决方法,但我不能让它工作。

This works great in every browser except IE. In IE all the tables display below the floated element on the right. I know there's a workaround for overflow hidden in IE but I can't get it to work.

下面的代码。

<head>
<style type="text/css">
.container{margin:0 auto; min-width:1000px; max-width:1200px;}
.sidebar{float:right;width:300px;margin-left:5px;}
.tholder{overflow:hidden;}
</style>
</head>
<div class="container">
<div class="sidebar">
<img src="dsfd.jpg" heigh="600" width="295">
</div>
<div class="tholder">
<Table width="100%" border="1"><tr><td>Text</td></tr></table>
</div>
<div class="tholder">
<Table width="100%" border="1"><tr><td>Test goes here</td></tr></table>
</div>
<div class="tholder">
<Table width="100%" border="1"><tr><td>text</td></tr></table>
</div>
</div>


推荐答案

当某些东西在其他浏览器中有效,机会是你的标题是不正确的。请检查这一个:

When something works in other browsers but not in IE9, chance is that your header isn't correct. Check with this one :

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

这篇关于IE9浮动溢出:隐藏和表格宽度100%不正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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