繁体   English   中英

如何在使用CSS属性Contain时防止剪切2个背景?

[英]How can I prevent clipping of 2 backgrounds while using the CSS property Contain?

我想在页面的顶部和页面的底部有一个背景。 使用此CSS可以给我正确的效果,但是可以将某些分辨率的图像裁剪在一起。 有没有办法停止剪辑效果?

body{
position:static;
background-image:url(images/header.png), url(images/footer.png);
background-size:contain, contain;
background-position:center top, center bottom;
background-repeat:no-repeat, no-repeat;
}

我通过交换图像有点作弊,但是到目前为止,这是我的解决方案: http : //jsbin.com/otuvuj/1

这是您想要的效果吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM