Because we will need to apply two backgrounds we have to create an additional box positioned absolutely that will contain all of the other elements. A sort of wrap if you like.
|
<div class="headerbackground"> <div class="content"> Content </div> <div class="navigation"> Navigation </div> <div class="header"> Header image </div> </div> |
Think of this box as the lowest layer in a stack of four layers.
Let's apply a background image to it. We chose to specify headerbg.jpg as a background image because that's the image we want repeated (for expansion). We will also add other CSS references such as height: 267px; in order to ensure it as high as the Header box (the fact that it wraps the entire body doesn't) and width:100%; in order to ensure it stretches to a maximum.
|
div.headerbackground { background: url("images/headerbg.jpg") repeat-x 0px 0px transparent; margin: 0px; height: 267px; position: absolute; width: 100%; z-index: 1; } |
At the same time we place the header image as a background for the Header box. The way our header image is created requires us to align it to the left in order to create the desired effect.
|
div.header { background: url("images/header.jpg") repeat-x 100% 0% transparent; } |
The 100% reference aligns the background of the Header box to the right.
The headerbackground box will expand as much as the resolution allows it to and creates the illusion that the header image expands.
|
body { background: url("images/headerbg.jpg") repeat-x 0px 0px transparent; } |
Back to Website Builder Tips: Making A Web Site Accessible
Home | Privacy | Contact Us | Bobby Accessibility Report | Website Hosting | Valid XHTML! | Valid CSS!
Unrelated Articles: Tempur-Pedic Memory Foam | Micro Dermabrasion | Magnetic Mattress and Pads | Claddagh Jewelry | Chocolate Fountain