Why does a header that is in a fixed position need a top:0?

I understood that a fixed position element is out of the ‘flow of the document’. Why do we need top:0 to hold it to the top of the page? I am creating a page and added a margin to a section underneath the header and the fixed header reacted to this margin? What is happening when we leave top out? I’m not really understanding. Thanks

    position: fixed;
    top: 0;

A fixed position element is positioned relative to the viewport , or the browser window itself. You need to tell the browser where you want the element to be placed. top: 0; tells the browser to place it 0 px from the top of the view port.

@bbsmooth, thanks for reply. If you leave out the top:0 how does it determine its position? Why does it react with margins of other elements?