Html 应用css后台附件时遇到问题
以下是我申请的css部分,以提供以下背景:Html 应用css后台附件时遇到问题,html,css,background-image,responsive-images,Html,Css,Background Image,Responsive Images,以下是我申请的css部分,以提供以下背景: #banner{ background: #242a33 url(../images/sliderbg.jpg) no-repeat 50% 50%; background-size: cover; background-position:center; background-attachment: fixed; } 我在其他部分使用相同的css代码,效果很好。我不知道这里有什么问题。背景图像大小为1600px*400px。开关背景大
#banner{
background: #242a33 url(../images/sliderbg.jpg) no-repeat 50% 50%;
background-size: cover;
background-position:center;
background-attachment: fixed;
}
我在其他部分使用相同的css代码,效果很好。我不知道这里有什么问题。背景图像大小为1600px*400px。开关
背景大小:封面代码>到<代码>背景大小:包含代码>。您可能需要修改背景位置
,并将其设置为背景位置:顶部编码>以获得所需的效果。哪幅图像是所需的结果?我希望图像覆盖整个宽度,甚至放大和缩小。我已经尝试过包含它带来的空间或图像固定不工作背景大小:自动100%代码>你想把你的代码放在一个提琴里,这样我就可以看一看,不用猜了?我以前从来没有用过提琴,但我把代码放在了各自的字段里,不知道如何插入图像。小提琴链接嗨,我尝试了上面的代码,但当我缩小了bg图像幻灯片到左边,但我希望它是固定的全宽bg
#Banner {
background-size: 100% 100%;
background-attachment: fixed;
background-position: center;
background: url('PathToImage');
display: table;
margin: 0;
padding: 0;
width: 100%;
height: 600px;
}