0

我想要一个在背景图像(#page)上覆盖紫色的 div,以覆盖整个页面,而不仅仅是页面的一部分。目前,如果页面不滚动,它会覆盖页面,但一旦页面需要用户滚动,就会发生这种情况:

http://darynjohnson.com/Medical%20Futures/winners.php

我尝试将位置更改为静态,但完全停止滚动。

已解决:刚刚将紫色 div 更改为溢出:滚动;- 谢谢

4

2 回答 2

0

例如,您可以将紫色放在另一个 div 中。

<style>
body { background: img 'yoururl.jpg'; }
#purple {background-color: rgba(120,46,134,0.6);}
</style>

<body>
<div id="purple">
your content
</div>
</body>
于 2012-08-24T18:01:27.520 回答
0

You need to set your background image to fixed. You can do this like that:

<body background="yourimage.jpg" bgproperties="fixed">

You could also let your background move with the content using CSS. The following lines would do that:

<style type="text/css">
body
{
      background-image:url('yourbackground.jpg');
      background-repeat:no-repeat;
}
</style>
于 2012-08-24T17:58:35.047 回答