Margins everywhere!

Posted in: How to

Want to get rid of those unsightly default margins and not having any luck? All browsers by default add margins and padding to your page that are somewhat of an eye sore. In order to get rid of that you will need to use the good ol’ wildcard selector *

It’s very simple to get rid of, I have seen fixes for this such as using negative margins to move the content up, this is a big no no – I see it more as opening up a can of worms once you start doing things like that.

Here’s how to do it the right way

* {margin:0; padding:0;}

/* add this to the body as well*/

body {margin:0; padding:0;}

Leave a Reply

Your email address will not be published. Required fields are marked *