Click to See Complete Forum and Search --> : div height full size of page


marcusami
04-29-2008, 08:49 AM
hey
okay so say you wanted a red stripe going down the whole side of your page
if you do 100% it makes it as big as the visible page, but if you scroll down it doesnt keep going. How do you make an item so that
it goes from 0px top to 0px bottom no matter what the size of the page is

thanks
Marcus

matth
04-29-2008, 09:17 AM
Either use a repeating backround image on the body element, or try this...

.stripe {
border-left: 3px solid red;
position: fixed;
height: 100%;
}

marcusami
04-29-2008, 09:51 AM
thanks for your post.
that doesnt quite work in my situation

I have a wrapper or container div
inside it i have a theRightStripe div
and its set to 500px - but i want to have it so that no matter what it is as long as the page is

heres the code
css

#container{
position:relative;
width:900px;
/*background-color:#d6ae84;*/
margin: 0 auto;
}

#stripe{
position: relative;
margin-left:-10px;
top:60px;
width:102%;
height:220px;
background-color:#d6ae84;

}

#theHead{
position:absolute;
margin-top:-205px;
margin-left:650px;
background-image:url('images/leatherhead_head_b.gif');
width:250px; height:265px;
}
#theRightStripe{
position:absolute;
margin-top:60px;
margin-left:650px;
width:250px; height:500px;
background-color:#8c5931;
}

#theTopLogo{
position:absolute;
margin-top:-205px;
margin-left:100px;
background-color:#b67444;
width:550px; height:45px;

}
#theLogo{
position:absolute;
margin-top: -160px;
margin-left:0px;
width:650px; height:220px;
background-image:url('images/logo_c.gif');
}



html

<body>
<div id="stripe"></div>
<div id="container">
<div id="theHead"></div>
<div id="theRightStripe"></div>

<div id="theTopLogo">Louisville, Ky</div>
<div id="theLogo"></div>
<br><br><br><br><br>
</div>

</body>
</html>


the page is at http://www.readyidea.com/leatherhead/index_a.php

regards
Marcus

matth
04-29-2008, 11:55 AM
#theRightStripe{
position: absolute;
margin-top:60px;
margin-left:650px;
width:250px; height:100%;
background-color:#8c5931;
}

Is this what you mean...?

matth
04-29-2008, 12:00 PM
Ignore that - I just followed your link and realised exactly what you wanted and that wont work.

marcusami
04-29-2008, 12:05 PM
yea ive made some changes on that page, but still same problem
Ive gone through this exact problem before I just cant figure out
how to settle it.

thanks for your posts!
regards
Marcus

IL14N4
04-29-2008, 01:42 PM
This could problably be achieved with floats. Though you would have to re arrange you're whole code.
Something to mention, or ask you really,why do you use margin-left, margin-top top to offset the
position for the divs in your page. The most proper way would be to use the left and top properties.

When building an html page its crucial that you're html code be organize properly....

marcusami
04-29-2008, 03:28 PM
yea i dont ever know what I am doing! ha

regards
Marcus

IL14N4
04-29-2008, 10:53 PM
I'm working on a solution

Centauri
04-29-2008, 11:36 PM
The biggest problem here is all the unnecessary absolute positioning - with everything out of the document flow, no element can have any influence over any others. If things are allowed to stack naturally, the background of #theRightStripe can be a repeated background image on #container, or even a wide right border on #container with the contents of #theRightStripe floated over it with a negative right margin - a few different ways of approaching this.

The #stripe div is also totally unnecessary - that should just be a horizontally repeated graphic on the body background.

marcusami
04-30-2008, 08:40 AM
my code is nasty i know
I really need to brush up on html/css
I am just forcing everything because I havent
taken the time lately to get up to date on syntax
and proper ways of doing everything - I am just getting
back into the computer scene

BUT i am thankful for your comments, its just
making me realize how much more attention
and time i need to put into it

regards
Marcus

IL14N4
04-30-2008, 01:54 PM
The #stripe was totally removed instead a .gif image will be used, this will be specified in the css. Here's the html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body>


<div id="container">
container <!--This title here is for visualization when loaded on
the browser you can remove it afterwards-->

<div id="mast"> <!-- div right here (#mast) will act as the container
for the #theTopLogo, #theLogo, #theHead -->
masthead

<div id="theTopLogo">Louisville, Ky the top Logo</div>
<div id="theLogo"> the Logo</div>
<div id="theHead">the Head</div>
</div>

<div id="theRightStripe">
the Right Stripe
<p>Content Here</p>
<p>Content Here</p>
<p>Content Here</p>
<p>Content Here</p>
<p>Content Here</p>
<p>Content Here</p>
<p>Content Here</p>
<p>Content Here</p>
<p>Content Here</p>
<p>Content Here</p>
<p>Content Here</p>
<p>Content Here</p>
<p>Content Here</p>
<br />
</div>

</div>
</body>
</html>

Here's the CSS:


body {
margin:0; padding:0;

/* the next 3 css rules are for the stripe image */
background-image:url(../images/stripe.gif);
background-repeat:repeat-x;
background-position: 0px 70px;
}


#container{
position:relative;
top:0px; /* you can remove this by default it's offset 0px from the top */
width:900px;
height:auto;
background-color:#d6ae84;
overflow:hidden;
margin:0 auto;
border:2px solid red; /*for visualization creates the outline
you can remove it */
}

#mast{
position:relative;
top:0px; /* default - can be remove if you want */
width:920px;
margin:0 auto;
border:1px solid blue; /* can remove it */
}

#theHead{
position:absolute; /* absolute instead of relative to close the gap
that the #theHead creates in the document flow*/
top:20px;
left:650px;

/* image goes here*/
background-image:url('images/leatherhead_head_b.gif');
width:250px;
height:265px;
margin:0px;
margin-left:5px; /* can remove it, lower or increase the margin
you decide how close you want #theHead to be
to the #theLogo */
border:1px solid orange; /*can remove it */

}

#theLogo{
position:relative;
top:0px; /*default - you can remove */
left:0px; /* default - you can remove */

/* your image goes here */
background-image:url('images/logo_c.gif');
width:650px;
height:220px;
border:1px solid red;
}

#theTopLogo{
position:relative;
top:0px; /*default - you can remove */
left:100px;
background-color:#b67444;
width:550px;
height:45px;
border:1px solid red; /* remove */
}

#theRightStripe{
position:relative;
top:0px; /* this is the default you can remove it */
left:656px;
background-color:#8c5931;
width:250px;
height:100%;
padding-bottom:15px;
border:1px dashed gray; /*can remove*/
}

marcusami
04-30-2008, 02:04 PM
thank you!
http://www.readyidea.com/leatherhead/index_b.php

i like how you even did the borders to point out everything
thank you for your time

regards
Marcus