Get a free trial // 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:

    < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

    Untitled Document

    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.


    # 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.

    html, body {


    # 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.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed