Grow your CSS skills. Land your dream job.

Problem with getting rid of margin of main div (SOLVED)

  • # December 7, 2008 at 4:57 pm

    Greetings. I am working on a simple layout consisting of 4 divs nested within a single div called "master". Everything is looking good except for the fact that the "master" div is showing up 10 pixels from the top of the browser when I am trying to get it to butt up right against it.

    And here is the code:

    Code:
    < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




    I assume this would be a simple fix for a more advanced CSS programmer. Any ideas on what the problem is? I appreciate your time and response. Thanks.

    Sincerely,
    IASIIS

    Rob
    # December 7, 2008 at 5:10 pm

    your browser has a default margin/padding for rendering the <html> tag from the sides.

    basically add this to the top of your CSS to sort out that.

    Code:
    html, body {
    padding:0;
    margin:0;
    }

    :)

    # December 9, 2008 at 7:39 am

    Hey Rob. Thanks for that code! :D :idea:

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".