Forum Moderators: open
body {
margin-top: 0;
}
Nick
Since this thread is on the subject....does anyone have any reasoning behind having/not having the margins? For one, yeah, you get a teeny bit more space to play with....but is there anything else involved here? (im sure someone has a list of reasons as to why they chose a nomargin site) :)
Back in the "old days" where where content was laid out as a simple document, browsers provided default spacing so headings and paragraphs did not "butt-up" flush against the sides of the display window.
It was when Web developers moved from simple document creation to "desktop publishing" that the ability to control margins became an issue. Logos, images, colored tables and contrasting table cells were the hot new toys. Add the today's popular <div> and throw in some DHTML, and margin control gains even greater importance.
The default "padding" that browsers once inserted as a "nicety" now became an annoyance.... to those developers from the "design school" of Web site creation.
Also consider FRAMES, at times, Internet Explorer will obscure content on the right "margin" of a content frame that invokes a scrollbar AND relies on default margins. The scrollbar does not "push" the content to the left, it simply covers it up. This "problem" is easily overcome through the use of margins or padding.
There are enough exceptions and variations to more than justify the need for margin control if a Web document will include "side-hugging" design elements or trigger scrollbars.
For most applications, margins (the defined space outside of an element's default boundry) and padding (the defined space between and element's default boundry and the content within) are mostly interchangeable. It is important however to know the differences between the two, especially if you "sidle over" into the realm of CSS-P! ;)