Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Why is there a black space between my divs??

Posted on 2011-04-24
5
Medium Priority
?
197 Views
Last Modified: 2012-05-11
Hi, I put a div around my form and story area and now for some reason there is black in between my top div (the title) and the bottom two divs (the form, and the story area).  Anyone can enlighten on this??

http://auroriella.com/story.html
0
Comment
Question by:FairyBusiness
5 Comments
 
LVL 1

Expert Comment

by:idusty
ID: 35457900
story.css

on row 82 you have defined:
margin: 20px 0;

That means:
margin-top:20px;
margin-bottom:20px;
margin-left:0;
margin-right:0;

Have this instead:

margin: 20px 0 0 0;
0
 
LVL 10

Expert Comment

by:c_a_n_o_n
ID: 35457903
You have
 
#title {
background:none repeat scroll 0 0 #FFFFFF;
border:3px solid #FFA0CF;
color:#000000;
display:block;
font-size:35px;
letter-spacing:2px;
margin:20px 0;
padding:8px 0;
text-align:center;
}

Open in new window

Change to
 
#title {
background:none repeat scroll 0 0 #FFFFFF;
border:3px solid #FFA0CF;
color:#000000;
display:block;
font-size:35px;
letter-spacing:2px;
padding:8px 0;
text-align:center;
}

Open in new window


Basically, you have a 20px margin.
0
 

Author Comment

by:FairyBusiness
ID: 35457916
but I want the margin. . . I just don't want the black space!!! I mean how can it be black???  It should be the same color as the background
0
 
LVL 13

Accepted Solution

by:
jonahzona earned 2000 total points
ID: 35457925
The reason it is black is because the margin is exposing part of the markup that isn't a div - it is actually the body element. And you have the body element set to #000000, which is black.

You can change this by changing the color of the body element in your css.

As an alternative, you should fill up those areas with styled div's instead of simply using the margins. This way you will have total control.

Make sense?
0
 

Author Closing Comment

by:FairyBusiness
ID: 35457928
Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Suggested Courses
Course of the Month11 days, 17 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question