frifox
01-05-2008, 01:09 AM
I have a main DIV with other divs inside it, in 2 layers. 1st layer is the pretty background, and the 2nd layer is the content. everything is okay untill the content extends beyond the window size.
SITE DEMO: LINK (http://golosmira.com/site)
then.... scroll bars appear, but when scrolling in FF/IE7, the background layer stays static and content text extends past the parent DIV.
in IE6, the content text is even more awkward. no scrollbars and text extends to past the window to the top! check out the screenshots below:
FF/IE7 screenshot:
http://img150.imageshack.us/img150/7804/ffie7rv2.png (http://img512.imageshack.us/img512/9907/ffie7zn0.png)
IE6 screenshot:
http://img299.imageshack.us/img299/6944/ie6gc2.png (http://img512.imageshack.us/img512/5725/ie6rg0.png)
You can check out the site below:
http://golosmira.com/site
and here are the HTML/CSS sources:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Welcome</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<link rel="stylesheet" href="css.style.css" type="text/css" />
</head>
<body>
<div id="main">
<div id="TL"></div>
<div id="TR"></div>
<div id="BL"></div>
<div id="BR"></div>
<div id="T"></div>
<div id="L"></div>
<div id="R"></div>
<div id="B"></div>
<div id="X">
01<br />02<br />03<br />04<br />05<br />06<br />07<br />
08<br />09<br />10<br />11<br />12<br />13<br />14<br />
15<br />16<br />17<br />18<br />19<br />20<br />21<br />
22<br />23<br />24<br />25<br />26<br />27<br />28<br />
29<br />30<br />31<br />32<br />33<br />34<br />35<br />
36<br />37<br />38<br />39<br />40<br />41<br />42<br />
43<br />44<br />45<br />46<br />47<br />48<br />49<br />
50<br />51<br />52<br />53<br />54<br />55<br />56<br />
</div>
</div>
</body>
</html>
* {
padding: 0;
margin: 0;
border: 0;
}
body, html {
width: 100%;
height: 100%;
font-size: 16px;
}
#main {
height: 100%;
width: 100%;
margin: 0 auto;
position: relative;
background-color: #f9f6f3;
}
#TL {
height: 150px;
width: 150px;
position: absolute; top: 0; left: 0; z-index: -1;
background-image: url(img.mainbg.topleft.png);
}
#TR {
height: 150px;
width: 150px;
position: absolute; top: 0; right: 0; z-index: -1;
background-image: url(img.mainbg.topright.png);
}
#BL {
height: 150px;
width: 150px;
position: absolute; bottom: 0; left: 0; z-index: -1;
background-image: url(img.mainbg.botleft.png);
}
#BR {
height: 150px;
width: 150px;
position: absolute; bottom: 0; right: 0; z-index:-1;
background-image: url(img.mainbg.botright.png);
}
#T {
height: 150px;
width: 100%;
position: absolute; top: 0; z-index: -2;
background-image: url(img.mainbg.top.png);
}
#L {
height: 100%;
width: 150px;
position: absolute; left: 0; z-index: -2;
background-image: url(img.mainbg.left.png);
}
#R {
height: 100%;
width: 150px;
position: absolute; right: 0; z-index: -2;
background-image: url(img.mainbg.right.png);
}
#B {
height: 150px;
width: 100%;
position: absolute; bottom: 0; z-index: -2;
background-image: url(img.mainbg.bot.png);
}
#X {
height: 100%;
width: 100%;
position: absolute; bottom: 0; z-index: 0;
text-align: center;
}
This is my first shot at the DIV based layout. what i'm shooting for it to have background be 100% height/width, BUT if the content extends past the window size - i want background to extend as well.
Can anyone help me with this problem, it drives me nuts :eek:!
thanks for all your help in advance!
SITE DEMO: LINK (http://golosmira.com/site)
then.... scroll bars appear, but when scrolling in FF/IE7, the background layer stays static and content text extends past the parent DIV.
in IE6, the content text is even more awkward. no scrollbars and text extends to past the window to the top! check out the screenshots below:
FF/IE7 screenshot:
http://img150.imageshack.us/img150/7804/ffie7rv2.png (http://img512.imageshack.us/img512/9907/ffie7zn0.png)
IE6 screenshot:
http://img299.imageshack.us/img299/6944/ie6gc2.png (http://img512.imageshack.us/img512/5725/ie6rg0.png)
You can check out the site below:
http://golosmira.com/site
and here are the HTML/CSS sources:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Welcome</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<link rel="stylesheet" href="css.style.css" type="text/css" />
</head>
<body>
<div id="main">
<div id="TL"></div>
<div id="TR"></div>
<div id="BL"></div>
<div id="BR"></div>
<div id="T"></div>
<div id="L"></div>
<div id="R"></div>
<div id="B"></div>
<div id="X">
01<br />02<br />03<br />04<br />05<br />06<br />07<br />
08<br />09<br />10<br />11<br />12<br />13<br />14<br />
15<br />16<br />17<br />18<br />19<br />20<br />21<br />
22<br />23<br />24<br />25<br />26<br />27<br />28<br />
29<br />30<br />31<br />32<br />33<br />34<br />35<br />
36<br />37<br />38<br />39<br />40<br />41<br />42<br />
43<br />44<br />45<br />46<br />47<br />48<br />49<br />
50<br />51<br />52<br />53<br />54<br />55<br />56<br />
</div>
</div>
</body>
</html>
* {
padding: 0;
margin: 0;
border: 0;
}
body, html {
width: 100%;
height: 100%;
font-size: 16px;
}
#main {
height: 100%;
width: 100%;
margin: 0 auto;
position: relative;
background-color: #f9f6f3;
}
#TL {
height: 150px;
width: 150px;
position: absolute; top: 0; left: 0; z-index: -1;
background-image: url(img.mainbg.topleft.png);
}
#TR {
height: 150px;
width: 150px;
position: absolute; top: 0; right: 0; z-index: -1;
background-image: url(img.mainbg.topright.png);
}
#BL {
height: 150px;
width: 150px;
position: absolute; bottom: 0; left: 0; z-index: -1;
background-image: url(img.mainbg.botleft.png);
}
#BR {
height: 150px;
width: 150px;
position: absolute; bottom: 0; right: 0; z-index:-1;
background-image: url(img.mainbg.botright.png);
}
#T {
height: 150px;
width: 100%;
position: absolute; top: 0; z-index: -2;
background-image: url(img.mainbg.top.png);
}
#L {
height: 100%;
width: 150px;
position: absolute; left: 0; z-index: -2;
background-image: url(img.mainbg.left.png);
}
#R {
height: 100%;
width: 150px;
position: absolute; right: 0; z-index: -2;
background-image: url(img.mainbg.right.png);
}
#B {
height: 150px;
width: 100%;
position: absolute; bottom: 0; z-index: -2;
background-image: url(img.mainbg.bot.png);
}
#X {
height: 100%;
width: 100%;
position: absolute; bottom: 0; z-index: 0;
text-align: center;
}
This is my first shot at the DIV based layout. what i'm shooting for it to have background be 100% height/width, BUT if the content extends past the window size - i want background to extend as well.
Can anyone help me with this problem, it drives me nuts :eek:!
thanks for all your help in advance!