First, set up a block. If you're using table layouts then a TD will do, though in this case you should learn to do real layout. If you're using a real layout, then a div will work best.
Ahem. Assign that block an id; anything will do as long as you don't use that id for anything else on the page. We'll assign our block an id of "foo", for the following:
<. div id="foo">
</div>
Now, in your CSS, set the background of the div to the image you want to use as the div's background. For a div with an id of foo, it might look like this:
Code:
#foo {
background-image: url(url-of-image);
height: height-of-image;
margin: 20px;
}
Now here's the trick: Set the height for the div, but
do not set a width for it. You can set margins (I set 20-pixel margins in the example), but no width. This will ensure that the browser calculates the width of the div on its own, using the width of the window and the margins you set. This will lead to the cool resizable-banner effect.