【问题标题】:Firefox css height 100% problem. How to fix?Firefox css 高度 100% 问题。怎么修?
【发布时间】:2019-07-15 10:52:27
【问题描述】:

我有一张表格,里面有 div 的 tds。 Div 应该适合所有 td 的高度。

Tds 有height: 1px; 并且 tds 中的 div 有 height: 100%;

这里是页面链接http://websitebuilder.su/workfox/index.php

但在 Firefox 中,这个技巧不起作用。我怎样才能让它无处不在?

chrome version

firefox version

【问题讨论】:

  • 是否设置为 ``` div { display: block; } ``` ?示例 html&css 会有所帮助。
  • @WebMari 它根本没有帮助

标签: html css firefox


【解决方案1】:

如果您将图像的样式更改为:

section.main_stages table td > div > div > img {
    /* margin-top: 15px; */
    /* margin-left: 8px; */
    position: absolute;
    top: 15px;
    left: 8px;
}

将封闭的 div 向左浮动并给它一个相对位置:

section.main_stages table td > div > div {
    width: calc(100% - 42px - 4px );
    float: left;
    padding-bottom: 24px;
    position: relative;
}

并摆脱 100% 的高度:

section.main_stages table td > div {
    width: auto;
    /* height: 100%; */
}

这似乎可以在 FireFox 中解决。

【讨论】:

  • 这样缩放图像可能会遇到问题,但在 FireFox 和 Chrome 中似乎可以正常工作。
猜你喜欢
  • 2011-09-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-09-15
  • 1970-01-01
  • 2014-02-27
  • 1970-01-01
相关资源
最近更新 更多