Get "www.yourname.com" for your MySpace page. Learn how >>.

With every domain name you register with ZappyHost, you get free (ad supported) hosting AND online website builder.

PLUS you get:

  • Quick Blogcast
  • Starter Web Page
  • Email Account
  • & much more! (Total value $123 for FREE!)

Get your FREE hosting today! >>

Fixed Background Code

You can use the background-attachment property to fix the position of a background image so that its position is fixed (even if it's containing block scrolls):

This results in:

This example shows how a background image can be set to a fixed position - even though its containing block scrolls. The contents of this box forces scroll bars to appear. When you scroll, you'll notice the image remains fixed.

Shorthand Background Code

There's a quick way of setting all background properties of an HTML object. You can use the CSS background property to set all the background properties at once:

This results in:

This box has had its all it's background properties set using the 'background' property. The background property is shorthand for setting many properties at once.

Enjoy this site?

  • Add this page to your Favorites
  • Link to this page from your website
  • Add this page to your favorite social bookmarks sites:      

Thanks for supporting Code-Generator.net!

Privacy Policy