调整视差图像的麻烦,如何做出响应

时间:2018-09-26 19:11:03

标签: html css flexbox responsive

how it looks full screen

div exceeding image

我希望图像/ div响应窗口的大小调整,而不是图像将文本推到上方,我希望调整圆形图像的大小,我知道问题是由于设置了像素,但是当我尝试时使用百分比会破坏布局。我将半径为div的背景图像放在div内,并尝试在div上设置高度,并使用百分比设置图像,但它完全消失了。我试图在Codepen上重新创建。

https://codepen.io/m4rsibar/details/mGNYXL

.2container{
  display:flex;
  flex-direction:column;
  max-height: 500px;

}

.secondimg{
  background-image: url(http://unsplash.it/800/800);
  height: 500px;
  width:500px;
  background-attachment: fixed;
  border-radius: 50%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: 70%;
  position:relative;
}

0 个答案:

没有答案