html - 在 Firefox 中显示表格布局损坏
问题描述
在每个主流浏览器(Chrome/Safari/IE/Edge)和 Firefox 中都试过这个。适用于除文本被轻推的 Firefox 之外的所有应用程序。
.auto-height {
display: table;
height: 100%;
}
.full-height-section {
display: table-cell;
height: 100%;
width: 49%;
background-image: url("https://preview.ibb.co/iNcv0f/ladysquats.jpg");
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
.half-content {
width: 100%;
height: 100%;
vertical-align: top;
padding: 60px 30px;
}
.half-content h2, .half-content p, .half-content ul {
text-align: center;
}
.half-content .img-size-payment-type {
width: 65%;
}
button.colour-dark-pnk, button.colour-light {
font-size: 1em;
margin-top: 25px;
padding: 10px 60px;
border: 0 solid #f4a2a4;
border-radius: 0;
cursor: pointer;
}
}
<div class="how-works-section-six-container auto-height mobile-screen-hide">
<div class="full-height-section">
</div>
<div class="section-six half-content">
<h2>IPSUM LOREM</h2>
<p> <img class="img-size-payment-type" src="https://preview.ibb.co/f0Ea0f/metodos-pago.png"><br>
<a href="/shop"><button class="colour-dark-pnk">Order now</button></a></p>
<h2 class="font-colour-dark-pnk">Test Title</h2>
<p>Ipsum Lorem Ipsum Lorem:</p>
<ul class="box-pnk">
<li>Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem.</li>
<li>Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem.</li>
</ul>
</div>
</div>
更奇怪的是,一旦使用“检查元素”,问题就会消失,这意味着很难看到发生了什么。看起来像一个实际的浏览器错误?
解决方案
全部更改height:100%
为min-height:100%
这是一个 Firefox 错误。两周前,我在开发我的网络应用程序时遇到了这个问题。
推荐阅读
- svg - 如何更改svg中路径的位置?
- python - 如何从 Python 中的多行字符串中提取复合词
- ios - 如何使用 Flutter MethodChannel 从原生 swift 代码调用 dart 代码中的方法?
- python - 我需要通过以下用户消息分配一个变量,我该怎么做?
- javascript - VSCode,用户片段在使用时不显示 $
- r - 根据另一列 R 的条件创建函数
- python - 在 GeoPandas 中,在用户定义的纬度经度框中选择(线串)数据
- azure - 您能否建议如何解决 azure web 应用程序的 URL 重写规则问题?
- windows - 使用 Powershell 创建交互式计划任务
- r - 使用 sep=" \ " 时出现单独的 {tidyr} 错误的问题