Help with keeping my content within my <DIV> tags.
Posted: 04 November 2010 01:10 PM   [ Ignore ]
Newbie
Rank
Total Posts:  3
Joined  2010-11-03

I am having trouble getting my content to go inside of my container <DIV>. It all ends up below the bottom of my background. I’ve been stuck on this for three days. Please help!

Also, any idea why I am getting so much empty space at the bottom of the page? And in Mozilla to the right is much empty space as well.  The more content I add the more it grows. Shouldn’t my body only stay wide and high enough to contain actual content?

Thanks.

htmlbody {

 margin
0;
 
colorblack;
 
width100%;
 
height100%;
 
margin-leftauto;
 
margin-rightauto;
 
padding0;
 
text-aligncenter;
 
/* background-image: url("images/dk-green-rect.jpg"); */
 /* background-attachment: fixed; */
 
 
}

div
#frameBG {
    
   
top:0
   
left:0
   
width:100%; 
   
height:100%;
   
z-index1;
   
 
}


div
#container {
 
   
margin0 auto;
   
width900px;
   
text-alignleft;
   
z-index2;
}


/* Styling for masthead */

div#logo {
   
   
positionrelative;
   
top50px;
   
border0;
   
padding0;

 
}

div
#headPic1 {

   
positionrelative;
   
top50px;
   
left0px;
   
border0;
   
padding0;
   
margin0;
 
}

div
#headPic2 {

   
positionrelative;
   
left223px;
   
top: -69px;
   
border0;
   
padding0;
   
margin0;
 
}

div
#headPic3 {

   
positionrelative;
   
left447px;
   
top: -188px;
   
border0;
   
padding0;
   
margin0;
 
}

div
#headFooter {

   
positionrelative;
   
top: -188px;
   
border0;
   
padding0;
   
margin0;
 
}

 div
#leftCol {

   
width150px;
   
positionrelative;
   
top: -918px;
   
left0px;
   
border2px;
   
padding10px;
   
background-color#CCCC00;
   
text-aligncenter;
 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


<
HTML>
 <
HEAD>
   <
link rel="stylesheet" type="text/css" href="style.css">
</
HEAD>

<
BODY>

 <
DIV id="frameBG"><img src="images/dk-green-rect.jpg" width="100%" height="100%"></DIV
 
  <
DIV id="container">
   
   <!-- 
Setup the header area  -->
   
   <
DIV id="logo"><img src="images/header_01.jpg"></DIV><DIV id="headPic1"><A HREF="images/pic1.jpg" TARGET="new"><IMG SRC="images/header_02.jpg" WIDTH=223 HEIGHT=119 BORDER=0 ALT=""></A></DIV><DIV id="headPic2"><A HREF="images/pic3.jpg" TARGET="new"><IMG SRC="images/header_03.jpg" WIDTH=224 HEIGHT=119 BORDER=0 ALT=""></A></DIV><DIV id="headPic3"><A HREF="images/pic2.jpg" TARGET="new"><IMG SRC="images/header_04.jpg" WIDTH=222 HEIGHT=119 BORDER=0 ALT=""></A></DIV><DIV id="headFooter"><IMG SRC="images/header_05.jpg" WIDTH=669 HEIGHT=55 ALT=""></DIV>

   <
DIV id="leftCol">    

     <
DIV   ...bunch of stuff here </DIV>
     <
DIV   ...bunch of stuff here </DIV>
         <
DIV   ...bunch of stuff here </DIV>

   </
DIV>

  </
DIV>
 </
BODY>
<
HTML
Profile
 
 
Posted: 04 November 2010 01:40 PM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  1
Joined  2010-11-04
harleyhar - 04 November 2010 01:10 PM

I am having trouble getting my content to go inside of my container <DIV>. It all ends up below the bottom of my background. I’ve been stuck on this for three days. Please help!

Also, any idea why I am getting so much empty space at the bottom of the page? And in Mozilla to the right is much empty space as well.  The more content I add the more it grows. Shouldn’t my body only stay wide and high enough to contain actual content?

Thanks.

div#frameBG {
    
   
top:0
   
left:0
   
width:100%; 
   
height:100%;
   
z-index1;
   
 

...

 <
DIV id="frameBG"><img src="images/dk-green-rect.jpg" width="100%" height="100%"></DIV
 
  <
DIV id="container">
   
... 

you put a div which is 100% / 100% in front of your code (#frameBG)- that moves all your content down the page. Just leave it out or put your other DIVs inside.

Put some coloured borders to your DIVs - then its much easier to see the problems ( border:1px solid #f00;)
You should also think about some DIVs with height and width and margins instead of all that “positioning” of your elements.

btw: your DIV tag is open - should be

<DIVcontent </DIV
Profile
 
 
Posted: 04 November 2010 01:56 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  3
Joined  2010-11-04

you put a div which is 100% / 100% in front of your code (#frameBG)- that moves all your content down the page.

Very nice post, i love this forum!

Profile
 
 
Posted: 04 November 2010 02:34 PM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  3
Joined  2010-11-03

Thanks, I made some of your changes and now at least some things are coming up on top of the background. A step in the right direction!

Profile
 
 
Posted: 04 November 2010 02:42 PM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  3
Joined  2010-11-04

Works for me too!

Profile