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 ?

        <div id="Container">
            <div id="header">
                <div id="top_header"><img src="MBHeader.png"/></div>



Post a Reply


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


    <body style="margin: 0px;">
        <div id="Container">
            <div id="header">
                <div id="top_header">
                    <img src="MBHeader.png"/>
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


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