html - 响应式背景 CSS 登陆

标签 html css background frontend responsive

下午好 试图在我着陆时做出响应式背景,但出于某种原因我不能 我试图使用 height: auto, height: 100% 和 margin: 0 auto;高度 100% 有效,但它没有覆盖到我的屏幕下方,我拥有的超出了我的需要。 这是我的代码:

    .crossfade > figure {
  animation: imageAnimation 48s linear infinite 0s;
  backface-visibility: hidden;
  background-size: cover;
  background-position: center center;
  height: 470px;
  left: 0px;
  opacity: 0;
  position: absolute;
  top: 189px;
  width: 100%;
  background-color: rgba(0,0,0,.3);
  background-blend-mode: darken;
  z-index: 0;
}

唯一对我有用的是:

height: calc(100vh - 189px);

189px 它从我的标题菜单中缩进,但是我有什么办法可以让它在没有计算的情况下工作吗? 希望你明白我的意思 谢谢

最佳答案

试试这个

.crossfade > figure {
  animation: imageAnimation 48s linear infinite 0s;
  background-size: cover;
  background-position: center center;
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left:0;
  right:0;
  bottom:0;
  background-color: rgba(0,0,0,.3);
  z-index: 0;
}

关于html - 响应式背景 CSS 登陆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55214470/

相关文章:

html - 水平对齐另一个div内的多个div而没有边距

html - 在 div 中垂直居中列表

css - div 标签中的 float 在 Firefox 中不起作用

php - .htaccess 将 css 重定向到 php

jquery - 强制 LI 出现在上一项的下一项上

css - 背景色和背景色有什么区别

css - IE8 截掉背景图片

html - 为什么我的背景图片有时会消失?

html - 在 CruiseControl 仪表板中显示 HTML 报告

css - 在浏览器中放大时的图像替代品