Jump to content

Recommended Posts

Hello all.

 

I am trying to make a DIV stretch to the bottom of the page on a site I am doing for a friend. I have actually managed to do it, it looks good, but the problem is that the page scrolls down a lot, when theirs nothing their to scroll down for.

 

Here is the website.

 

As you can see, some unwanted scrolling occurs, which I would like rid of.

 

Here is the code I have so far:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Red Alert Fire</title>
<style type="text/css">
<!--
html,
body {
height: 100%;
}
#wrapper {
width: 750px;
margin-left: auto;
margin-right: auto;
}
#header {
background: url(header.gif);
height: 200px;
}
.border-l,
.border-r {
background: url(border.gif) left repeat-y;
position: absolute;
height: 100%;
width: 750px;
}
.border-r {
background: url(border.gif) right repeat-y;
}
-->
</style>
</head>

<body>

<div id="wrapper">
  <div id="header"> </div>
  
  <div class="border-l">
  <div class="border-r">
  </div>
  </div>

</div>

</body>
</html>

 

If anybody would be kind enough to have a look through it and maybe guide me in the right direction, I would be most grateful.

 

Thanks for your time,

 

Chris.

Link to comment
https://forums.phpfreaks.com/topic/37200-100-div-stretch-trick-problems/
Share on other sites

looks like it is adding the 200px header to the 100%.  Your code doesn't make much sense.  Drop that .border crap and apply the background image to the wrapper. You declare the same background image twice.  Why do you want the page to be 100%? Let the content decide the height.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.