【问题标题】:CSS: size of the elements changes in a very strange way in ChromeCSS:元素的大小在 Chrome 中以一种非常奇怪的方式变化
【发布时间】:2013-03-23 23:28:15
【问题描述】:

我遇到了仅在 Google Chrome 中才注意到的奇怪问题:通过开发人员工具检查元素大小(图像、内表)时会发生变化。

重现步骤:

  1. 打开 Chrome 开发者工具。
  2. 开放元素
  3. 从元素层次结构中选择任何包含表格table#inner的元素

结果:元素每次选择都会增加尺寸(指元素),直到达到指定尺寸

相关问题:table#inner 必须根据 table#outer td 元素的大小更改自己的大小,但它没有

代码示例: page.jsp

<div id="outer_div">
<table id="outer">
  <tr>
    <td>
    </td>
    <td>
      <table id="inner">
        ......
      </table>
    </td>
  </tr>
</table>
</div>

style.css

#inner {
  width: auto; // or 100%;
}

与:300 像素;工作正常)

附:在 Firefox 中一切正常

【问题讨论】:

    标签: html css google-chrome


    【解决方案1】:

    如果你的意思是#inner 应该占据#outer 的大小 那么,

    #inner {
        min-width:100%;
    }
    

    或

    #inner {
        width:100%;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-03
      • 1970-01-01
      • 2022-01-18
      相关资源
      最近更新 更多