宽度100%问题IE [英] width 100% problem IE

查看:62
本文介绍了宽度100%问题IE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在IE宽度为100%时遇到问题,我正在尝试在div标签中创建一个宽度为100%的表格.现在的问题是表格的宽度是在浏览器上而不是在父页面上获得100%的宽度...这是我的html结构

Hello guys im having problem with IE width 100%, I''m trying to create a table within a div tag with a width of 100%. now the problem is the width of the table is getting its 100% with on the browser and not on the parent... here is my html structure

<html>
  <body>
    <div id="test">
      <div id="inner_test">
         <table>
           <tr>
               <td>A value</td>
               <td>A value</td>
               <td>A value</td>
               <td>A value</td>
               <td>A value</td>
               <td>A value</td>
           </tr>
         </table>
      </div>
    </div>
  </body>
</html>



并在css文件中添加了此



and inside the css file its this

#test{
  background-color: #ccc;
}
#inner_test{
 margin-left: 20px;
 margin-right: 20px;
}
#inner_test table{
 width: 100%;
}



因此,我期望该表适合容器"inner_test",但似乎它在其父级(即测试)的父级上获得其宽度

我要在这里实现的目标是即使它们缩小也会有一张宽度为100%的桌子...顺便说一句div测试是位于我的浏览器右侧的div标签...您看到我有一个左div标签位于左侧位置...我试图创建2列布局,而我的测试div是具有动态宽度的右侧div ...



so i was expecting that the table will fit the container "inner_test" but it seems that it gets its width on the parent of its parent which is the test

what im trying to achieve here is having a table with width of 100% even if they zoom out... by the way div test is a div tag located on the right side of my browser... you see i have a left div tag that is position on the left side... im trying to create a 2 column layout and my test div is the div on the right with a dynamic width...

推荐答案

我比较了Mozilla(SeeMonkey),Chrome和IE. IE很烂!但是,它基本上起作用了.我观察到一个不同的问题:您的背景色并未覆盖IE的最大缩放比例,但在其他浏览器中看起来还不错.

如果已修复,则可以通过设置table样式的背景来解决. td的背景也可能会有所帮助.

—SA
I tried it, compared Mozilla (SeeMonkey), Chrome and IE. IE sucks! However, it basically worked; I observed a different problem: your background color did not cover all the table on extreme zoom with IE, but it looked fine in other browsers.

If fixed it by setting the background for the table style instead. A background for td can also be helpful.

—SA


这篇关于宽度100%问题IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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