[英]div left responsive image fixed 100% height and div right text scrollable
[英]image that has 100% height and stretches to the right and left
试试object-fit:cover;
它会裁剪您的图像。
#image {
width: 100%;;
height: 200px;
object-fit:cover
}
加上@media
您可以使图像适应屏幕分辨率。
.container { display: flex; justify-content: center; align-items: center; } .image { flex: 0 1 auto; }
<div class="container"> <img class="image" src="http://blog.conservation.org/wp-content/uploads/2014/06/ci_19290600_cropped.jpg" /> </div>
.image { background-repeat: no-repeat; background-position: center center; height: 500px; /* whatever you need */ }
<div class="image" style="background-image: url(http://blog.conservation.org/wp-content/uploads/2014/06/ci_19290600_cropped.jpg);"></div
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.