Web International Awards

23

JUN 2009 0

Fixed background

Achieving a fixed background on a webpage is not so difficult. However, there's lots of topics out there (especially on forums), with lots of solutions to this problem, including some javascript or flash techniques. The point is that you don't need javascript, nor flash to achieve this. Especially flash! The trick is simple. You must set the background not to repeat, and the make it fixed. You do that by adding "background-attachment: fixed;" to your css code and you're done. The rest of background positioning must be done just as you would on any other background.

Here's a demo, and here's the source code for the demo. If you liked this article you can subscribe to the full content rss feed and stay updated as we post new information.

Published on Tuesday, June 23rd, 2009 at 8:28 am in code, css.

There are no comments. You can be the first to post one.





Save time next time! You won't have to fill out all these fields again. Register in just a few clicks and then login.

If you do not have a username, you can register in just a few clicks.