Space between two Div tags

I was working on a small blog form, but I was having problems with my Div tags. Whenever I create a second div tag to hold the Form, there is a space between it and the previous Div tag. Is there something wrong with my CSS?

body {
 background-image: url(../images/body-bg.jpg);
 font-family: arial;
}

#header {
 background-image: url(../images/new-post-h.png);
 background-repeat: no-repeat;
 height: 124px;
 width: 850px;
 color: #ffffff;
 margin: 0em 0px;
}

#form-bg {
 background-image: url(../images/new-post-b.png);
 background-repeat: no-repeat;
 height: 500px;
 width: 850px;
 padding: 8px;
 margin: 0em 0px;
}

#new-form {
 height: 624px;
 width: 850;
 margin-left: auto;
 margin-right: auto;
}

      

Here's what's going on: http://i40.tinypic.com/j623i8.jpg

+2


a source to share


1 answer


Two things:

1) Based on the look and feel of your image (assuming it's 100% size and which elements are your header, etc.), your header background is only 50px. However, you define the height to be 124px in your CSS. You cannot stretch the background image with CSS (as far as I know), so the image will not fill the element size.



2) In the declaration for, #new-form

add a block to width

. Otherwise it will not work as expected and you will also get a parser error.

+1


a source







All Articles