How do I remove the top margin in a web page?

Solution 1:

Is your first element h1 or similar? That element's margin-top could be causing what seems like a margin on body.

Solution 2:

I had similar problem, got this resolved by the following CSS:

body {    
    margin: 0 !important;
    padding: 0 !important;
}