0
我想提出一个背景(宽度= 1250px)为中心的网页上,但容器,应该有浏览器中心的背景+全页容器
该中心的背景宽度:
#container{margin:0 auto;background:#000 url("images/background.jpg") no-repeat;width:1250px;;}
而这个设置容器的宽度=浏览器
#container{margin:0 auto;background:#000 url("../../../images/background.jpg") no-repeat;width:100%;position:relative;}
如何获得居中的背景图像和整页容器?
谢谢!
'margin:0 auto;'是一个错字(ctrl c + ctr v issue = D)。我从来没有想过'中心中心'有一段时间会有用,所以我最终放弃了没有测试的解决方案。 –