How to Fix a background Image while the page is being Scrolled | Using CSS



To make a background image static while the content scrolls over it, we have to use the background-attachment property like so,

CSS Code:
<style>
img { background-image: url(background.png);background-attachment:fixed;}
</style>

Comments

Check out

CSS Sprites | What are They?

Login form | Using CSS3

HTML5 Semantic Tags | What do they mean

Remove Scrollbars from syntaxhighlighter

Adding a button in HTML | styling a button

How CSS3 Works

HTML5 | LocalStorage

Advanced Jquery easing | Demo and Download

How to add Jquery easing effects | Jquery tutorial