Go to the Starcraft II website at http://us.starcraft2.com/ and scroll down to the bottom of the page. Notice how it appears like you are looking out of a cockpit.
As you scroll up and down the stars move independently from the cockpit windows creating a layered effect.
How do they get two images to move independently of each other?
Edit: Thanks for the replies below. I did notice they were using a transparent .png image, but I was interested in how they got the "sliding" effect, where the planet comes into view as you scroll down.
I didn't have my dev environment available last night to work through it, but I figured it out now.
It is achieved by having a pair of nested div tags. The background of the parent one is 'fixed' and the background of the child one is set to 'scroll.' The relevant css is below:
<style type="text/css">
.parent
{
background: url("/Images/Fixed Image.png") no-repeat fixed 50% 100% transparent;
position: relative;
height: 800px;
}
.parent div
{
background: url("/Images/Scrolling Image.png") no-repeat scroll 50% 190px transparent;
height: 100%;
}
</style>
And the html:
<div class="parent" >
<div>
</div>
</div>