背景图片封面在较小的屏幕上不起作用

时间:2018-11-08 13:10:29

标签: css background-image cover

我想使用图片作为标题的背景。 这是现在的样子:

A rectangular photo with a curved bottom edge and a red curved line just below it.

现在这是我的手机版本: A taller rectangular photo with a straight bottom edge. There is white space between the photo and the curved red line.

如您所见,这里不需要空白。我尝试使用vh / vw,将车身高度设置为100%,但这不起作用。

.home .part1-img-container {
  min-height: 650px;
  background-color: grey;
  background: url(assets/img/brooklyn.jpg) no-repeat center center scroll;
  background-size: cover;
  background-repeat: no-repeat;
  text-align: center;
  /*padding-top: 70px;*/
  border-bottom-left-radius: 50% 10%;
  border-bottom-right-radius: 50% 10%;
  margin-bottom: 10px;
  background-position-y: -187px;
}
<div class="part1 col-md-12 col-lg-12 p-0">
  <div class="part1-img-container">

  </div>
</div>

0 个答案:

没有答案