DEV Community

Discussion on: Master CSS positioning in 5 minutes

Collapse
 
javascriptacademy profile image
Adam Nagy

Hi!
Because it removes the element from the standard document flow.

In a normal document flow if not overriden by CSS a div takes 100% of its parent’s container.

After the element is positioned absolutely and removed from the document flow, it takes a min eidth which is defined by the browser. If the content is larger than this width the it will take the required place to display its content.

So we have to specify the width of the absolutely positioned element manually.

Collapse
 
babafemijk profile image
babafemij-k

Oh wow.
Cool, thanks a lot!