tiamat2012
Programmer
Hey everone,
I'm looking for a CSS way to get the repeat-x function to go as far as it can.
Right now I'm using a javascript funciton that determines the width of my banner and maincontent ( , but because I am determining an absolute width of the two divs, when you resize the window the divs stay the in the same place, cutting off the text of the rest of the site.
Does anyone know how I can change this?
I am quite willing to get rid of the javascript function all together if I can manage to do ith with CSS, or not, either way.
I'm using position:absolute on all my divs, I'm not sure if this is a problem or not. I'm mainly doing it because when I do float:left it doesn't work in IE.
Here's my javascript code
and my CSS for the divs
Thanks!
Kerry
I'm looking for a CSS way to get the repeat-x function to go as far as it can.
Right now I'm using a javascript funciton that determines the width of my banner and maincontent ( , but because I am determining an absolute width of the two divs, when you resize the window the divs stay the in the same place, cutting off the text of the rest of the site.
Does anyone know how I can change this?
I am quite willing to get rid of the javascript function all together if I can manage to do ith with CSS, or not, either way.
I'm using position:absolute on all my divs, I'm not sure if this is a problem or not. I'm mainly doing it because when I do float:left it doesn't work in IE.
Here's my javascript code
Code:
function fixWidth()
{
var maincontent, header, changeto;
changeto = document.body.offsetWidth - 400; // Set the width of the columns, left column = 200px, right column = 200px
changeto = (changeto*100)/document.body.offsetWidth;
maincontent = document.getElementById("maincontent"); // Get center column
header = document.getElementById("header"); // Get top column
maincontent.style.width = changeto + "%"; // Set center column's width
header.style.width = changeto + "%"; // Set top column's width
}
and my CSS for the divs
Code:
div#logo
{
position: absolute;
width: 200px;
height: 200px;
background: #FFFFFF url(images/leftcorner2.jpg) repeat-x scroll top left;
z-index: 1;
}
div#header
{
position: absolute;
left: 200px;
height: 200px;
text-align: center;
background: #FFFFFF url(images/SLtopbanner2.jpg) repeat-x scroll top left;
}
div#lmenu
{
position:absolute;
top: 200px;
width:200px;
background: #FFFFFF url(images/Slbanner.jpg) repeat-y fixed top left;
}
div#maincontent
{
position: absolute;
top:200px;
left: 200px;
background: transparent fixed;
}
div#rbanner
{
position:absolute;
top: 200px;
right: 0px;
width: 200px;
background: #FFFFFF url(images/SLrbanner.jpg) repeat-y fixed top right;
}
div#rcenter
{
position:absolute;
width: 200px;
right: 0px;
height: 200px;
background: #FFFFFF url(images/rightcorner2.jpg) repeat-x scroll top right;
}
Thanks!
Kerry