Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.