div with position:absolute (for parent position:relative ), with top:0 , with left:0 indented at the top (not counting the standard margin the body ).
But if you remove the paragraph, the div will be without this indent.
Why is that?
body { position: relative; font-family: Arial; } div { position: absolute; top: 0; left: 0; margin: 0; border: 1px solid gray; background: white; color: black; padding: 5px; } <p>paragraph paragraph paragraph paragraph</p> <div>div div</div>
bodytagposition: relativestyle required? - Alexan-Dwerposition: relativeforbody- Alexan-Dwer