Can't kill that magin

+2 Matthieu Burot · July 31, 2014
Hey there,

i am kind of new here but i watched all of bucky's html/css tutorials. So now i am going to try out some stuff. I wanted to add an image of an header to the top of a plain page but i cant get the margin off. I mean the margin between the website and the image. I thought i just put the margin of my "container" to 0 but it doesnt work :(

One weird thing about it is.. that there is only margin on top and on the left hand side..

Any ideas ?

"<html>
    <head>
        <title>versuch</title>
    </head>
    <style>
        
    </style>
    <body>
        <div id="Container">
            <div id="header">
                <div id="top_header"><img src="MBHeader.png"/></div>

            </div>


        </div>
    </body>"

Post a Reply

Replies

Oldest  Newest  Rating
+2 Franz Schmidt · July 31, 2014
Found it you have to set the margin of the body tag to 0px.


<html>
    <head>
    <title>versuch</title>
    </head>

    <body style="margin: 0px;">
        <div id="Container">
            <div id="header">
                <div id="top_header">
                    <img src="MBHeader.png"/>
                </div>
            </div>
        </div>
    </body>
</html>
Sorry couldn't write in code tags :/ they don't work at the moment :ermm:
0 Matthieu Burot · August 1, 2014
thx !!!

but why is there margin between my container and the body ? is that by default ? like do i have to keep that in mind for all pages i am gonna do ? or is that just something i created by doing something ?

thank u so much for that fast reply :)
  • 1

HTML / CSS / Web Design

107,317 followers
About

Discuss, share, ask, learn and teach HTML5 and CSS3.

Links
Moderators