html - css: why texts will move up after remove position:absolute -


html code:

<!doctype html> <html>     <head>         <style>             h2 { position:absolute;}         </style>     </head>     <body>         <h2>this heading absolute position</h2>     </body> </html> 

question:

if remove line: position:absolute;, texts in <h2>...</h2> move up, why?

in default view, without css...

when position: absolute; there, margins not collapsed.

enter image description here


when remove position: absolute;, margins collapse, , gets mingled body's margin.

enter image description here


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -