Why is there a space in between my divs?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tx9271
    New Member
    • Sep 2010
    • 12

    Why is there a space in between my divs?

    For some reason there is a gap in between some of my <divs>. It doesn't happen at the top to my header and navbar but once I go into my body it starts and I can't figure out why. any help would be greatly appreciated. Heres the link to the page : http://naturalfoodrepo rts.com/chiaseedreport. php

    and heres all the code on that page:
    Code:
    <!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=utf-8" />
    <title>Natural Food Reports</title>
    <link href="root/reports style/reports.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <div id="wrapper">
    <div id="header">
        <div id="title"><a href="index.php" class="titlelink">Natural Food Reports</a></div>
      </div>
    <div id="navbar">
      <div id="homereportsaboutcontact"><a href="index.php"> Home</a> | <a href="reports.php">Reports</a> | <a href="about.php">About</a> | <a href="contact.php">Contact</a></div>
    </div>
    <div id="reportstitle">
      <p>~Chia Seeds~</p>
      <p><img src="imgs/Health &amp; Super Foods/ChiaSeeds&amp;OtherSeeds/chia seeds.jpg" alt="chiaseeds" width="200" height="200" border="0" /></p>
    </div>
    <div id="researchresultstitle";>Research Results:</div>
    <div id="researchresults">
      <p>&quot;...when you hydrate the seeds in water the seeds shell opens up and absorbs   up to nine times its volume in water. This then forms a gel, which is   called Chia Seed Gel. It is said that the gel has the potential to help   keep your body hydrated. The gel is also 90% soluble fiber, which may be   beneficial for your digestive track. Many people say that they use the   seeds when they are involved in sports or physical activities for   endurance.&quot; </p>
      <p>&quot;....the seeds have twice the protein of any other seed or grain, five times   the calcium of milk, boron which is trace mineral that helps transfer   calcium into your bones, omega 3 and omega 6 which are essential oils   for the body.&quot;</p>
    <p>&quot; ...the soluble fiber in the gel forms a wall between carbohydrates and the   body, releasing them slowly into the body. Dieters love the seeds   because it can be added to any food or drink in a ratio of 75% to the   volume of food or drink and will not change the taste. Because the   carbohydrates are released slowly you may get the feeling of being full.   Many use the seeds as a way to control their appetites. The gel has no   taste.&quot; </p>
    </div>
    <div id="logo">Eat Better. Feel Better. Live Better.</div>
      <div id="footer">&copy; 2010  Natural Food Reports
    </div>
    </div>
    </body>
    </html>



    Heres the code on my external style sheet attached to that page:

    Code:
    body {
    	margin: 0px;
    	font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    	background-image: url(v2bg.jpg);
    }
    
    #wrapper {
    	margin: 0px;
    }
    
    #header {
    	background-image: url(newbanner.jpg);
    	height: 200px;
    }
    
    #title {
    	font-family: "Lucida Console", Monaco, monospace;
    	font-size: 55px;
    	color: #000;
    	position: absolute;
    	left: 320px;
    	top: 79px;
    	width: 669px;
    	height: 58px;
    }
    .titlelink:link{
    	color:#000;
    	text-decoration:none;
    	font-size: 50px;
    	font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    }
    .titlelink:hover { color:#000;
    }
    .titlelink:visited{ color:#000;
    text-decoration:none;
    }
    .titlelink:active{ color:#000;
    text-decoration:none;
    }
    #logo {
    	position:absolute;
    	width:284px;
    	height:32px;
    	z-index:1;
    	left: 322px;
    	top: 130px;
    	color: #FFF;
    }
    #navbar {
    	background-color: #FFF;
    	background-image: url(navbar.jpg);
    	background-repeat: no-repeat;
    	height: 30px;
    	width: 100%;
    	margin: 0px;
    }
    #homereportsaboutcontact {
    	color: #000;
    	margin-left: 400px;
    }
    #reportstitle{
    	font-size: 24px;
    	color: #000;
    	font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    	text-decoration: none;
    	background-color: #FFF;
    	text-align: center;
    	width: 800px;
    	margin-right: auto;
    	margin-left: auto;
    	clip: rect(0px,auto,auto,auto);
    }
    #researchresultstitle {
    	font-size: 24px;
    	text-align: center;
    	background-color: #FFF;
    	margin-top: 0px;
    	width: 800px;
    	margin-right: auto;
    	margin-left: auto;
    }
    #researchresults {
    	background-color: #FFF;
    	margin-right: auto;
    	margin-left: auto;
    	width: 800px;
    	font-size: 14px;
    }
    
    #footer {
    	background-color: #999;
    	height: 60px;
    	text-align: center;
    	font-weight: bold;
    	margin-bottom: 0px;
    }
    
    
    
    
    
    .bluelinks:link {
    	color:#00F;
    	font-size: 14px;
    }
    .bluelinks:visited { color:#00F;
    text-decoration:underline;
    }
    .bluelinks:visited { color:#00F;
    text-decoration:underline;
    }
    .bluelinks:hover { text-decoration:underline;
    }
    a:img{ border:0;
    }
    a:link{
    	color:#000;
    	text-decoration:none;
    	font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    	font-size: 18px;
    }
    a:hover{
    	color:#000;
    	text-decoration:underline;
    }
    a:visited{
    	color:#000;
    	text-decoration: none;
    }
    
    
    a:active{
    	color:#000;
    	text-decoration:none;
    	text-align: center;
    }
    tom
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Most elements have a default margin applied to them. I'm not on my dev computer to check but applying 'margin:0' to the paragraphs, divs will probably solve that.

    Comment

    • tx9271
      New Member
      • Sep 2010
      • 12

      #3
      my margins are auto for left and right and when i set the top to 0 nothing happens it still stays the same; with a gap. :(

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        You have margin set to zero on the divs but it's the p element that has margins that are pushing up against the other divs.

        Comment

        • tx9271
          New Member
          • Sep 2010
          • 12

          #5
          omg. lol thank you so much. i didnt even think to check that. thanks again

          Comment

          • tx9271
            New Member
            • Sep 2010
            • 12

            #6
            i just a new css rule for "p" making it have a margin 0 for all. that should fix the problem for good right?

            Comment

            • drhowarddrfine
              Recognized Expert Expert
              • Sep 2006
              • 7434

              #7
              Yes. Some people set margins on everything to zero and then reset them to what they want. Google for "CSS Reset". The problem is, if they are going to set it to something else anyway, why are they setting it to zero? That's why many don't think it's a good idea.

              Comment

              • tx9271
                New Member
                • Sep 2010
                • 12

                #8
                yea i just set all "p" to zero margin because I have margins left and right on auto for a lot of my divs so that wouldn't really work for me. but, i did solve this little problem thanks to you!!

                I really appreciate you taking the time to reply to my thread. Hopefully one day I can help people too like how you helped me. Thanks again!

                Comment

                Working...