【问题标题】:Body not covering the whole page with reactjs/react-bootstrap正文没有用 reactjs/react-bootstrap 覆盖整个页面
【发布时间】:2019-01-09 15:31:35
【问题描述】:

我的问题就像标题所说的那样,我有一个渐变背景,但它并没有覆盖整个页面,正如您在此处看到的那样,您会注意到在我的导航栏下方有一个稍微不同的颜色,我想要也修复

Result from using height:100vh

这是我的css代码

.App {
  text-align: center;
  color: black;
  background: #bdc3c7;  /* fallback for old browsers */
  background: -webkit-linear-gradient(to bottom, #2c3e50, #bdc3c7);  /* Chrome 10-25, Safari 5.1-6 */
  background: linear-gradient(to bottom, #2c3e50, #bdc3c7); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}

.CarouselIndex{
  margin-left: 10%;
  margin-right: 10%;
}

.navbar-brand {
  display: flex;
  align-items: center;
}
.navbar-brand>img {
  padding: 7px 14px;
}

.LogoHeader{
  color: white;
}

.Footer{
  background-color: black;
  position:relative;
	width: 100%;
	height: 80px;
	color:white;
  border-color: black;
  margin-bottom: auto;
	text-align: center;
  left: 0;
  bottom: 0;
}

.aboutimg{
  display: block;
  margin-left: auto;
  margin-right: auto;

}

.textarea{
  resize: vertical;
}

【问题讨论】:

  • 通常身体会有一个最小高度。您需要为问题的两个部分添加更多信息。特别是使用的 HTML。

标签: javascript html css reactjs


【解决方案1】:

当您将height: 100vh 添加到.App 类时,它可能会起作用。这个导航栏是从框架导入的吗?

【讨论】:

  • 如果我使用 height :100vh ,即使我没有任何内容,它也会一直下降,我只是在帖子中添加了一张图片,这样你就可以看到了。导航栏是从 react-boostrap 导入的
  • 所以你只想让页脚粘在底部?喜欢this post?或者您想在不影响任何其他元素的情况下使渐变整页?
猜你喜欢
  • 2018-01-06
  • 1970-01-01
  • 2022-07-09
  • 2022-07-20
  • 2016-09-28
  • 1970-01-01
  • 2012-08-20
  • 1970-01-01
  • 2020-12-24
相关资源
最近更新 更多