Question : Gaps between divs

Oh help. I'm in the midst of building a website, and I've got a couple of gaps that appear at the top and bottom of my mainContent div. Everything looks fine when I'm in design mode (in Dreamweaver), but the minute I switch to Live View or preview the page in FireFox or IE (haven't tried the rest)  the gaps appear.

Someone please tell me what I'm missing? I'm all out of intelligence for the day, but will check back in the morning for your suggestions.

Would really appreciate your help.

Thanks!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
MY HTML 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>newindex</title>
<link href="newindex.css" rel="stylesheet" type="text/css" /><!--[if IE 5]>
<style type="text/css"> 
/* place css box model fixes for IE 5* in this conditional comment */
.thrColFixHdr #sidebar1 { width: 180px; }
.thrColFixHdr #sidebar2 { width: 190px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.thrColFixHdr #sidebar2, .thrColFixHdr #sidebar1 { padding-top: 30px; }
.thrColFixHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
</head>

<body class="thrColFixHdr">

<div id="container">
  <div id="topmenu">
  <!--end #topmenu -->
  <img src="Images/topmenu.jpg" width="1090" height="47" /></div>
  <div id="header">
    <img src="Images/header.jpg" width="1090" height="443" alt="Author and Speaker" />
  <!-- end #header --></div>
  <div id="pagetop"><img src="Images/pagetop_gold.jpg" width="1090" height="28" />
  <!--end #pagetop --></div>
  <div id="sidebar1"><img src="Images/sidebar_left.jpg" width="156" height="436" />
    <!-- end #sidebar1 -->
  </div>
  <div id="sidebar2"><img src="Images/sidebar_right.jpg" width="156" height="436" />
    <!-- end #sidebar2 -->
  </div>

  <div id="mainContent">
  <div id="mainContentText"><h1>Main Content </h1>
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. </p>
    <h2>H2 level heading </h2>
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <!-- end #mainContentText --></div>
	<!-- end #mainContent --></div>
  
  <div id="footer">
   <img src="Images/footer_gold.jpg" width="1090" height="64" />
   <!-- end #footer -->
  </div>
<!-- end #container --></div>
</body>
</html>
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
MY CSS CODE:

@charset "utf-8";
body  {
	font: 100% Verdana, Arial, Helvetica, sans-serif; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
	padding: 0;
	text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
	color: #000000;
	width: 1090px;
	background-color: #640000;
	margin-top: 0;
	margin-right: auto;
	margin-bottom: 0;
	margin-left: auto;
	}
.thrColFixHdr #container {
	width: 1090px;
	text-align: left; /* this overrides the text-align: center on the body element. */
	margin-top: 0;
	margin-right: auto;
	margin-bottom: 0;
	margin-left: auto;
	background-color: #0F0;
	border-top-width: 0px;
	border-right-width: 0px;
	border-bottom-width: 0px;
	border-left-width: 0px;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	padding: 0px;
} 
.thrColFixHdr #header {
	background: #DDDDDD;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
	height: 443px;
	padding: 0;
} 
.thrColFixHdr #topmenu {
	height: 47px;
}
.thrColFixHdr #pagetop {
	margin: 0px;
	padding: 0px;

}

.thrColFixHdr #header h1 {
	margin: 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
	padding-top: 0px;
	padding-right: 0;
	padding-bottom: 0px;
	padding-left: 0;
	background-color: #640000;
}
.thrColFixHdr #sidebar1 {
	float: left; /* since this element is floated, a width must be given */
	width: 156px;
	padding: 0px;
	background-color: #640000;
}
.thrColFixHdr #sidebar2 {
	float: right; /* since this element is floated, a width must be given */
	width: 156px;
	padding: 0px;
	background-color: #640000;
}
.thrColFixHdr #mainContent {
	padding-top: 0;
	padding-right: 10;
	padding-bottom: 0;
	padding-left: 10;
	margin-top: 0;
	margin-bottom: 0;
	margin-left: auto;
	margin-right: auto;
	float: none;
	clear: none;
	top: 0px;
	background-color: #FFF;
	left: 0px;
	background-image: url(Images/page_gold.jpg);
	background-repeat: repeat-y;
	width: 778px;
} 
.thrColFixHdr #mainContentText {
	width: 600px;
	padding-left: 100px;
	margin: 0px;
	padding-top: 0px;
	padding-bottom: 0px;
}


.thrColFixHdr #footer {
	height: 85px;
	padding: 0;
	background-color: #640000;
	margin: 0px;
} 
.thrColFixHdr #footer p {
	margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
	padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
	float: right;
	margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
	float: left;
	margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
	clear:both;
    height:0;
    font-size: 1px;
    line-height: 0px;
}

Answer : Gaps between divs

Random Solutions  
 
programming4us programming4us