Jump to content

White space between DIV's


Eiolon

Recommended Posts

I have a top and bottom image, each in their own DIV.  However, there is white space that I cannot get rid of that is preventing the images from looking seamless.

 

Here is a screenshot of the image:

 

spacing.gif

 

The images are in the HEADER and MIDDLE divs.

 

#wrapper {
margin:0px auto;
padding:0;
border:0;
width: 1024px;
}

#header {
margin:0;
}

#container {
margin:0;
padding:0;
}

#left {
margin:0;
padding:0;
float:left;
width:255px;
}

#right {
margin:0;
padding:0;
float:right;
width:255px;
}

#middle { 
margin:0;
padding:0;
float:left;
width:514px;
}

 

<div id="wrapper">
<div id="header">
	<img src="header.jpg" alt="Header">
</div>
<div id="container">
	<div id="left">

	</div>

	<div id="middle">
		<img src="middle.jpg" alt="Middle">
	</div>

	<div id="right">

	</div>
</div>
</div>

Link to comment
https://forums.phpfreaks.com/topic/220374-white-space-between-divs/
Share on other sites

There's a couple poor coding habits I see here, they MIGHT BE contributing to the problem. Those DIVs you have, left and right, are those to center the middle DIV??

 

Try This:

<div id="wrapper">
   <div id="header">
      <img src="header.jpg" alt="Header">
   </div>
   <div id="container">
      <div id="middle">
         <img src="middle.jpg" alt="Middle">
      </div>
   </div>
</div>

 

CSS:

#wrapper {
   margin:0px auto;
   padding:0;
   border:0;
   width: 1024px;
}

#header {
   margin:0;
}

#container {
   margin:0;
   padding:0;
}

#middle {
   margin:0;
   padding:0;
   width:514px;
   margin-left: auto;
   margin-right: auto;
}

 

I didn't test it. If it doesn't work just let me know and I will put it into production real quick.

 

Hope this helps.

 

E

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.