Jump to content

[SOLVED] Black space where is should not be


sawade

Recommended Posts

There is space between two div layers, how ever I have zeroed out the margin and padding on both.  And yet there is still space.  Why are they not collapsing into each other?

 

<body>
<div id="body">
<div id="header">

 

body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: small;
width: 800px;
margin-left: auto;
margin-right: auto;
line-height: 1.7em;
margin-top: 0;
}

#body {
background-color: #EEE8CD;
border: medium #3D627F solid;
padding-bottom: 0;
margin-bottom: 0;
}

#header {
margin-top: 0;
padding-top: 0;
text-align: left;
background: #3D627F url(images/medwww.gif) top right no-repeat;
}

 

Thanks.

Link to comment
Share on other sites

* {

margin: 0;

padding: 0;

}

 

You should always declare this somewhere in your css styling.

 

EDIT: Do you have firebug installed? If not... GET IT.

 

I have tried that.  It does solve the space issue.  But all it does is create even more issues.  Using it eliminates ALL other spacing in the entire HTML doc.  Including spacing between paragraphs, lists, other defined margins, paddings, etc etc.  All text is completely squashed together, very unattractive.  So that code doesn't solve this issue.  Thanks.

Link to comment
Share on other sites

I prefer a CSS reset sheet over the method theFilmGod showed there, but that being said, his method is the next best thing (or the better thing, depending on who you ask). It does two things:

 

1) It starts all browsers off on equal footing, whereas without it, they will each have their own defaults

2) It forces you to set everything manually, to make sure it's exactly the way you want.

 

So, that being said, put the code he suggested at the very start of your CSS, then set everything manually after. It's a pain in the ass, but it's the better way of doing everything.

 

Or, if you REALLY don't want to do that (which really isn't a good idea), then try posting more of your code than you did. You didn't even show the closing tags for the divs you posted, or what was in them, or anything. We cannot guess what your code looks like.

Link to comment
Share on other sites

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.