How to Get Divs to Go to Edge

Hi Guys


How do I make the coloured divs go right to the edge of the browser, I thought it would be:

#container {
margin: 0;

but that doesn’t appear to work.


You need

body {margin: 0;}

Browsers have defaults styles, like margin and padding on various things, so some designers like to start with a “reset” that removes many of these defaults, such as:

html, body, h1, h2, h3, h4, h5, h6, p, a, blockquote, pre, code, hr, img, form, fieldset, legend, label, textarea, span, em, strong, sub, sup, cite, table, tbody, td, tfoot, th, thead, tr, tt, dl, dt, dd, ol, ul, li {margin: 0; padding: 0;}