473,395 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Why is there a space in between my divs?

12
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://naturalfoodreports.com/chiaseedreport.php

and heres all the code on that page:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Natural Food Reports</title>
  6. <link href="root/reports style/reports.css" rel="stylesheet" type="text/css" />
  7. </head>
  8.  
  9. <body>
  10. <div id="wrapper">
  11. <div id="header">
  12.     <div id="title"><a href="index.php" class="titlelink">Natural Food Reports</a></div>
  13.   </div>
  14. <div id="navbar">
  15.   <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>
  16. </div>
  17. <div id="reportstitle">
  18.   <p>~Chia Seeds~</p>
  19.   <p><img src="imgs/Health &amp; Super Foods/ChiaSeeds&amp;OtherSeeds/chia seeds.jpg" alt="chiaseeds" width="200" height="200" border="0" /></p>
  20. </div>
  21. <div id="researchresultstitle";>Research Results:</div>
  22. <div id="researchresults">
  23.   <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>
  24.   <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>
  25. <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>
  26. </div>
  27. <div id="logo">Eat Better. Feel Better. Live Better.</div>
  28.   <div id="footer">&copy; 2010  Natural Food Reports
  29. </div>
  30. </div>
  31. </body>
  32. </html>
  33.  



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

Expand|Select|Wrap|Line Numbers
  1. body {
  2.     margin: 0px;
  3.     font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  4.     background-image: url(v2bg.jpg);
  5. }
  6.  
  7. #wrapper {
  8.     margin: 0px;
  9. }
  10.  
  11. #header {
  12.     background-image: url(newbanner.jpg);
  13.     height: 200px;
  14. }
  15.  
  16. #title {
  17.     font-family: "Lucida Console", Monaco, monospace;
  18.     font-size: 55px;
  19.     color: #000;
  20.     position: absolute;
  21.     left: 320px;
  22.     top: 79px;
  23.     width: 669px;
  24.     height: 58px;
  25. }
  26. .titlelink:link{
  27.     color:#000;
  28.     text-decoration:none;
  29.     font-size: 50px;
  30.     font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  31. }
  32. .titlelink:hover { color:#000;
  33. }
  34. .titlelink:visited{ color:#000;
  35. text-decoration:none;
  36. }
  37. .titlelink:active{ color:#000;
  38. text-decoration:none;
  39. }
  40. #logo {
  41.     position:absolute;
  42.     width:284px;
  43.     height:32px;
  44.     z-index:1;
  45.     left: 322px;
  46.     top: 130px;
  47.     color: #FFF;
  48. }
  49. #navbar {
  50.     background-color: #FFF;
  51.     background-image: url(navbar.jpg);
  52.     background-repeat: no-repeat;
  53.     height: 30px;
  54.     width: 100%;
  55.     margin: 0px;
  56. }
  57. #homereportsaboutcontact {
  58.     color: #000;
  59.     margin-left: 400px;
  60. }
  61. #reportstitle{
  62.     font-size: 24px;
  63.     color: #000;
  64.     font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  65.     text-decoration: none;
  66.     background-color: #FFF;
  67.     text-align: center;
  68.     width: 800px;
  69.     margin-right: auto;
  70.     margin-left: auto;
  71.     clip: rect(0px,auto,auto,auto);
  72. }
  73. #researchresultstitle {
  74.     font-size: 24px;
  75.     text-align: center;
  76.     background-color: #FFF;
  77.     margin-top: 0px;
  78.     width: 800px;
  79.     margin-right: auto;
  80.     margin-left: auto;
  81. }
  82. #researchresults {
  83.     background-color: #FFF;
  84.     margin-right: auto;
  85.     margin-left: auto;
  86.     width: 800px;
  87.     font-size: 14px;
  88. }
  89.  
  90. #footer {
  91.     background-color: #999;
  92.     height: 60px;
  93.     text-align: center;
  94.     font-weight: bold;
  95.     margin-bottom: 0px;
  96. }
  97.  
  98.  
  99.  
  100.  
  101.  
  102. .bluelinks:link {
  103.     color:#00F;
  104.     font-size: 14px;
  105. }
  106. .bluelinks:visited { color:#00F;
  107. text-decoration:underline;
  108. }
  109. .bluelinks:visited { color:#00F;
  110. text-decoration:underline;
  111. }
  112. .bluelinks:hover { text-decoration:underline;
  113. }
  114. a:img{ border:0;
  115. }
  116. a:link{
  117.     color:#000;
  118.     text-decoration:none;
  119.     font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  120.     font-size: 18px;
  121. }
  122. a:hover{
  123.     color:#000;
  124.     text-decoration:underline;
  125. }
  126. a:visited{
  127.     color:#000;
  128.     text-decoration: none;
  129. }
  130.  
  131.  
  132. a:active{
  133.     color:#000;
  134.     text-decoration:none;
  135.     text-align: center;
  136. }
  137.  
tom
Sep 23 '10 #1

✓ answered by drhowarddrfine

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.

7 6120
drhowarddrfine
7,435 Expert 4TB
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.
Sep 23 '10 #2
tx9271
12
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. :(
Sep 23 '10 #3
drhowarddrfine
7,435 Expert 4TB
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.
Sep 23 '10 #4
tx9271
12
omg. lol thank you so much. i didnt even think to check that. thanks again
Sep 23 '10 #5
tx9271
12
i just a new css rule for "p" making it have a margin 0 for all. that should fix the problem for good right?
Sep 23 '10 #6
drhowarddrfine
7,435 Expert 4TB
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.
Sep 23 '10 #7
tx9271
12
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!
Sep 23 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: deepak datta | last post by:
Hello Gurus, please help suggest how I can remove the space between the top banner image & the rest of the page in: http://www.naturerugs.com/affiliate/default.asp I have tried numerous...
6
by: Tony T | last post by:
Can anyone help me with this - it may be obvious, but I just can't see it. I'm working with PC and WinME. In IE6, the two divs inside the wrapping div have no space between them, which is how I...
8
by: mattbostock | last post by:
URL: http://www.drfunkenstein.net/ Username: ciwas Password: password Hi, I'm having difficulty with getting the header image (top.png, background of div#container) to stay next to div#main...
2
by: D. Alvarado | last post by:
Hello I have 5 divs, and initially the lower 4 are hidden. I would like everything beneath the 5th div to appear flush against the first visible div. But right now, there is a gap of white...
1
by: tabert | last post by:
I want to use JavaScript when a button is clicked to show and hide a SPAN or DIV. This works in both IE and Netscape, but what I'd like to happen is for there to be no white space where the hidden...
3
by: Jordan S | last post by:
I have been using the old HTML unordered list in order to have bullet-point lists. But they don't look good because there is no white space between each list item. <UL> <LI>List Item Here...
5
by: dw | last post by:
hello - first, let me state that i am an Asp.Net rookie. here is the situation: i have a page that looks good in the vs.net designer, but when the page renders there are extra amounts...
8
by: maroger | last post by:
I'm sure this is a common issue, but I haven't come across anything that works for me thusfar. I am trying to fix my header, which works fine in firefox but has extra space in IE. Here are...
3
by: Veerle | last post by:
Hi, I have a list: <ul> <li>Li 1 - blablablablabla</div> <li>Li 2 - blablablablabla</div> <li>Li 3 - blablablablabla</div> <li>Li 4 - blablablablabla</div> <li>Li 5 - blablablablabla</div>...
8
by: removeps-groups | last post by:
Is there any way to control the space between top of browser or frame and document body? What I have is this: There is a simple file test1.html, and file test.html that displays test1.html in an...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.