2013-05-22 253 views
0

我正在修复我的第二个全宽图像(在页面中间的那个),以便在水平方向上与上面的标题图像中的图像一致。有人可以仔细检查我的CSS,看看它是否正确。它需要自动调整大小以适应上面的标题图像等屏幕。当我在移动设备上查看它时,它不适合。谢谢参观。全宽度背景图像调整

http://www.jobspark.ca

.fullWidthSectionBG { 
background-image: url('http://static.squarespace.com/static/513d5347e4b0abff73be5264/t/519c45c4e4b084baf13d7e27/1369195972115/rocktruck2.jpg'); 
border-bottom: solid 1px #ddd; 
border-top: solid 1px #ddd; 
margin-left: -1600px; 
margin-right: -1600px; 
padding-top:20px; 
padding-bottom:330px; 
overflow: hidden; 
background-position: center; 
background-repeat: no-repeat; 
background-size: auto; 
} 
+0

请参阅这个问题的答案在这里http://stackoverflow.com/a/16706285/2397883 – Joe

+0

织补还是无解。你知道如何做到这一点,如果它只是一个图像,而不是背景图像 –

回答

1

您需要在增加高度,以你的DIV我想。这是fiddle。我只是增加了一个高度的div,现在它调整罚款......这是你需要它做什么?

.fullWidthSectionBG { 
background-image: url('http://static.squarespace.com/static/513d5347e4b0abff73be5264/t/519c45c4e4b084baf13d7e27/1369195972115/rocktruck2.jpg'); 
width:100%; 
background-position:center; 
height:575px; 
} 

更新CSS(仍调整大小)

.fullWidthSectionBG { 
background-image: url('http://static.squarespace.com/static/513d5347e4b0abff73be5264/t/519c45c4e4b084baf13d7e27/1369195972115/rocktruck2.jpg'); 
background-position: bottom center; 
background-size: cover; 
height:575px; 
background-attachment: scroll; 
background-repeat: no-repeat; 
} 
+0

Didn't非常工作,我想如此不知道还有什么要尝试。我改变了我的CSS回到一些有点不同 –

+0

我在顶部背景图像div做了一个检查元素,就像你说的那样,所以我更新了我的答案。 –