小编Ast*_*oge的帖子

16:9填充底部技巧在FireFox中无法正常工作

我一直在尝试为内容块实现响应式16:9比率技巧,同时在Chrome中获得预期结果,其他浏览器(如FireFox和Edge)显示完全不同而不是预期.

.streamContainer {
  position: absolute;
  width: 80%;
  height: calc(100% - 120px);
  display: flex;
  bottom: 0px;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  transition: height 0.5s;
  background: blue;
}
.streamRatio {
  position: relative;
  width: 100%;
  padding: 56.25% 0 0 0;
  content: '';
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  display: block;
  background: red;
  height: 0;
}
.streamInner {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: green;
}
Run Code Online (Sandbox Code Playgroud)
<div class="streamContainer">
  <div class="streamRatio">
    <div class="streamInner">
      Content Goes Here
    </div> …
Run Code Online (Sandbox Code Playgroud)

html css firefox google-chrome

7
推荐指数
2
解决办法
3986
查看次数

标签 统计

css ×1

firefox ×1

google-chrome ×1

html ×1