1

I have an interesting situation, that I can't understand how resolve it.

enter image description here

I need something like this,

this is an example, the background in html is repeating, then we have wrapper, with fixed size centered horizontly, but in which I must see the background, but in this case not with light overlay (or opacity if you want), the images must match, , can anyone help me with this?

Here what I did http://jsfiddle.net/WfhHE/14/

4

2 回答 2

4

一个更简单的解决方案是将背景位置设置为center 50px. 因为您的内部 div 从顶部 50px 开始,并且宽度正好是背景图案的 5 倍,所以以下应该是几乎完美的:(工作 jsFiddle

html {
height: 1000px;
/* Note the following change */
background: #fff url(http://lh3.ggpht.com/-6jQdie_mJCE/UeV2RpGb87I/AAAAAAAAAJo/PDZsV3baNwU/s0/bg.jpg) center 50px repeat;
position: relative;
}
于 2013-07-16T17:05:15.310 回答
1

对于叠加图像,可以:

  • 使用普通的半透明颜色作为背景(使用rgba 和/或图像)来为它后面的图像着色
  • 使用background-attachment: fixed背景图片
于 2013-07-16T16:59:30.187 回答