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.

© Copyright 2006 - 2024 Code-Generator.net | Privacy Policy