Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
css中的图像背景_Css - Fatal编程技术网

css中的图像背景

css中的图像背景,css,Css,有没有办法在页面背景上动态调整图像大小?我有一个在Y轴上重复的背景,但是如果我将高度尺寸变大,并且如果页面包含的内容较少,那么背景就不适合。。有人能帮忙吗?谢谢简短回答:不 详细回答:确实,您想要的东西还不可能实现(也许在CSS3中?)。到目前为止,我认为最好的方法是使用CSS背景附件 body { background-attachment: fixed; /*background doesn't scroll out of the screen */ background-positio

有没有办法在页面背景上动态调整图像大小?我有一个在Y轴上重复的背景,但是如果我将高度尺寸变大,并且如果页面包含的内容较少,那么背景就不适合。。有人能帮忙吗?谢谢

简短回答:不


详细回答:

确实,您想要的东西还不可能实现(也许在CSS3中?)。到目前为止,我认为最好的方法是使用CSS背景附件

body {
 background-attachment: fixed; /*background doesn't scroll out of the screen */
 background-position: top center; /* background's center is in the center of the window */
}

有一些CSS3描述符可以做到这一点:

#my-id {background-size: 100% 100%;}

希望这有帮助

可能是一个复制品