Forum Moderators: not2easy

Message Too Old, No Replies

Problem with my code?

100% single Div

         

s32ialx

10:55 pm on Jan 29, 2008 (gmt 0)

10+ Year Member



I'm trying to get my website i am working to have the content div stretch the page but if i resize the window smaller the div shrinks until a certain point maybe if possible thus adding a scroll bar to the content


<style type="text/css">
body {
height:100%;
background-color: transparent;
background: url(../Images/bg.png);
background-repeat: repeat;
cursor:crosshair
}
a:hover {
background:url('')!important;
cursor:crosshair!important;
text-decoration:none!important;
color:#535252!important;
}
#background {
margin-left: auto;
margin-right: auto;
width: 550px;
height:160px;
background-color:transparent;
background-image: url(../Images/background.png);
}
#links {
margin-left: 23px;
width:513px;
height: 100%;
background-color:transparent;
}
#content {
margin-top: auto;
margin-left: auto;
margin-right: auto;
top:169px;
width: 552px;
height:100%;
background-image: url(../Images/page.png);
background-repeat: repeat-y;
}
.frame {
margin-top:0px;
margin-left: 23px;
width:513px;
background-color:transparent;
}
</style>
</head>
<!-- iframe layout -->
<body>
<div id="background">
<div id="links">
<a href="home.html" target="Main"><img src="../Images/home.png" border="0" alt=""></a>
<a href="about.html" target="Main"><img src="../Images/about.png" border="0" alt=""></a>
</div>
</div>
<div id="content">
<iframe class="frame" src="home.html" name="Main" scrolling="auto" frameborder="0">
</iframe>
</div>
<!-- user html end -->
</body>

any help i tried your tutorial on the 100% div height but it had no luck unless i am doing it wrong

Xapti

6:24 pm on Jan 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What kind of behavior do you want, though?

s32ialx

9:19 pm on Jan 30, 2008 (gmt 0)

10+ Year Member



more or less what i am trying to achieve is have the div layer auto resize when i resize the browser window so that it always stays the height of the window... but when it reaches a certain height it shows a scroll bar so that the text doesn't just disappear behind the div... i dunno if u know what i mean.. more or less I've seen footer divs that follow the bottom and if u resize the height then it goes up with the page and makes the lets say content div smaller but at a certain point if it gets to small i want a scroll bar to appear?

if not i at least want it to stop auto resizing at a certain height.

Xapti

4:31 am on Feb 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So do you just want a footer that rests on the bottom of the window if the content isn't long enough, but rests at the bottom of the content if it is taller than the window? It's a common request, you can try searching around here, I don't have any links for you handy though.

If it's not that you want, you might just be wanting a min-height? IE6 doesn't support it though, so you would have to use a javascript workaround, but if you want the div to fit the window until a minimum of n lines (use em), or n pixels, then that's all you need.