Php 背景图片对齐

Php 背景图片对齐,php,css,Php,Css,我的背景图片排列似乎不对。底部似乎被切断了。如何使背景图片与中间对齐 body { background-image: url('<?php echo $backgroundpic;?>'); background-repeat:no-repeat; background-position:center; background-attachment:fixed; width: 100%; height: 100%; } 正文{ 背景图像:url(“”); 背景重复:无重复; 背景位

我的背景图片排列似乎不对。底部似乎被切断了。如何使背景图片与中间对齐

body {
background-image: url('<?php echo $backgroundpic;?>');
background-repeat:no-repeat;
background-position:center;
background-attachment:fixed;
width: 100%;
height: 100%;
}
正文{
背景图像:url(“”);
背景重复:无重复;
背景位置:中心;
背景附件:固定;
宽度:100%;
身高:100%;
}


您只需添加背景大小并将其设置为覆盖

    body {
background-image: url('http://i.stack.imgur.com/eWFou.jpg');
background-repeat:no-repeat;
background-position:center;
    background-size:cover;//ANSWER
background-attachment:fixed;
width: 100%;
height: 100%;
}
希望能对您有所帮助。

尝试添加:

background-size: cover;

非常感谢。还有一个问题,背景图片似乎太大了。。我如何调整它以适应浏览器屏幕?背景尺寸:封面应注意这一点。你有可以共享的实时URL吗?没有实时URL。。。让我检查一下我的背景图片是否是问题所在,或者我是否可以裁剪我的图片