Hello,
I want to position my site's banner using CSS.
I have divided the image into 3 sections: the left end, middle, and right end.
I also have a 1px wide image that spans the entire width of the top to form the background for my banner.
I want the left and right ends to stay put at the edges of the browser, and I want the middle image to stay in the center of the browser (horizontally).
The problem is with my current code, when resizing the browser, the left and middle images stay put, but the right end image moves closer to the center as it gets smaller. Thats *almost* what I want it to do.
But I want the left AND right images to move closer to the center simultainously, as the middle stays put. This way, there is always an equal gap between the center image, and each image on either side of it.
Thanks in advance for any help/advice!
Here is my current code:
I want to position my site's banner using CSS.
I have divided the image into 3 sections: the left end, middle, and right end.
I also have a 1px wide image that spans the entire width of the top to form the background for my banner.
I want the left and right ends to stay put at the edges of the browser, and I want the middle image to stay in the center of the browser (horizontally).
The problem is with my current code, when resizing the browser, the left and middle images stay put, but the right end image moves closer to the center as it gets smaller. Thats *almost* what I want it to do.
But I want the left AND right images to move closer to the center simultainously, as the middle stays put. This way, there is always an equal gap between the center image, and each image on either side of it.
Thanks in advance for any help/advice!
Here is my current code:
Code:
#logo {
background: url(banleft.jpg) top;
height: 110px;
width: 122px;
}
#logo2 {
background: url(banright.jpg) top right;
height: 110px;
width: 145px;
position: absolute;
top: 0px;
right: 0px;
}
#logo3 {
background: url(banmid.jpg) top center;
height: 110px;
width: 407px;
position: relative;
left:50%
top: 0px;
margin-top: 0px;
margin-left: 200px;
}
/* Header */
#header {
background: url(banbg.jpg) repeat-x 0% 0%;
height: 110px;
}