Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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,我使用10x400像素的图像作为背景图像,css如下: body { background-image:url('bg1.png'); background-repeat:repeat-x; text-align: center; background-size:100% 100%; } 在chrome中,图像在chrome中扩展到屏幕的整个高度,但在firefox或IE中没有。帮助???尝试使用以下命令使其垂直和水平重复 background-repeat: repe

我使用10x400像素的图像作为背景图像,css如下:

body {
    background-image:url('bg1.png');
background-repeat:repeat-x;
    text-align: center;
    background-size:100% 100%;
}

在chrome中,图像在chrome中扩展到屏幕的整个高度,但在firefox或IE中没有。帮助???

尝试使用以下命令使其垂直和水平重复

background-repeat: repeat

尝试将
min height
添加到
html


不要认为
背景重复:如果使用
背景大小:100%100%
,则需要重复-x

我不希望它沿着高度重复,因为它有一个梯度,会给人留下一个不好的条纹。我将身体从最小高度部分移除后,它工作正常。否则对于chrome来说,随着屏幕的增加,它会给我一个滚动条
html{
    min-height: 100%;
}
body {
    background-image: url('path_to_img.png');
    text-align: center;
    background-size: 100% 100%;
}