Can anybody tell me why I have a white space at the top of my page???

Discussion in 'HTML & Website Design' started by cscott5288, Feb 24, 2010.

  1. #1
    cscott5288, Feb 24, 2010 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    Try this style:

    
    <style type="text/css">
    div#container
    {
    
    background-color: #EFF4F3;
    border-color:#000000;
    border-style:solid;
    border-width:0 7px;
    margin:0 auto;
    min-height: 1000px;
    width:950px;
    
    }
    
    
    div#header
    {
    background-color: #EFF4F3;
    }
    
    div#header h1
    {
    padding:0px 0 0 30px;
    line-height:.5em;
    
    }
    
    div#header img
    {
    padding:0px 0 0 30px;
    
    }
    
    div#header ul
    {
    padding:10px 10px 10px 30px;
    text-transform:uppercase;
    font-family:arial,verdana,helvetica,sans-serif;
    font-size:11px;
    color:#FFFFFF;
    background-color:#000000;
    border-bottom: 7px solid;
    border-color:#496964;
    margin: 0px;
    }
    
    
    div#header li
    {
    display:inline;
    margin:0 26px 0 0;
    }
    
    div#box {
    height:200px;
    width:920px;
    background-color:#EFF4F3;
    margin-left:30px;
    
    }
    
    div.boxs1 {
    height:200px;
    width:295px;
    background-color:#FFFFFF;
    float:left;
    margin:5px;
    
    
    }
    
    
    body
    {
    background-color:#FFFFFF;
    margin: 0px;
    padding: 0px;
    }
    
    h1
    {
    padding:0 30px 0 30px;
    color:545274;
    }
    
    p
    {
    font-family:"Times New Roman";
    font-size:20px;
    }
    
    div#main
    {
    background-color:#EFF4F3;
    }
    
    div#postarea
    {
    width:604px;
    min-height:500px;
    margin-left:30px;
    margin-top:20px;
    float:left;
    background-color:#FFFFFF;
    
    }
    
    div#sidebar
    {
    width:295px;
    min-height:500px;
    float:left;
    margin-left:10px;
    margin-top:20px;
    background-color:#FFFFFF;
    }
    
    div#footer
    {
    background-color:#000000;
    height:400px;
    width:100%;
    margin:0 auto;
    min-height: 200px;
    width:950px;
    border-color:#000000;
    border-style:solid;
    border-width:0 7px;
    
    }
    
    </style>
    
    Code (markup):
    I have only added margin: 0px; to div#header ul and margin: 0px; padding: 0px; to body.
     
    s_ruben, Feb 24, 2010 IP
  3. 80r

    80r Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You could always just do margin-top:-10px in the body tag. I'm very new to web design but I've used it before without any problems.
     
    80r, Feb 25, 2010 IP
  4. jackeyman

    jackeyman Peon

    Messages:
    81
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    you can check the original code and see if there is something innormal.
     
    jackeyman, Feb 25, 2010 IP
  5. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #5
    It works thanks ... I still don't understand why I have to do that though. Shouldn't the margin automatically be set to 0?
     
    cscott5288, Feb 26, 2010 IP
  6. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #6
    No, it is not 0px for body and ul.
     
    s_ruben, Feb 26, 2010 IP
  7. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #7
    don't know what you are saying
     
    cscott5288, Feb 26, 2010 IP
  8. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #8
    I have answered to this question. :)
     
    s_ruben, Feb 26, 2010 IP
  9. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #9
    I know that you need to set the margin to 0 to fix the problem but I am wondering why you need to do that? Shouldn't the margin be set to that automatically?
     
    cscott5288, Feb 26, 2010 IP
  10. typingmums

    typingmums Well-Known Member

    Messages:
    1,446
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    140
    #10
    What does it matter? You have your solution!

    body (
    margin: 0;
    }

    fixed! :)
     
    typingmums, Feb 26, 2010 IP
  11. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #11
    I want MORE THAN A SOLUTION. I WANT KNOWLEDGE!! KNOWLEDGE I TELL YOU IS WHAT EMPOWERS ME!
     
    cscott5288, Feb 26, 2010 IP