Home > front end >  The difference between the absolute positioning and floating
The difference between the absolute positioning and floating

Time:10-16

Absolutely positioned elements from the document flow, so do not occupy a space, the layout of the common element in the document flow is the same when there is no absolutely positioned elements, because of the absolute positioning frame has nothing to do with the document flow, so they can override of the other elements on the page,
And floating element positioning is based on the normal document flow, and then is pumped from the document flow and move as far away as possible to the left or the right, the text content will be around the floating element, when an element is pumped from the normal flow of the document, is still in the other elements in the document flow to ignore the element and fill his original space, it just changed the document flow, according to not from the document flow, understand this, it is easy to understand when to use the positioning, when to use floating,
After floating an element or absolute positioning, it will automatically be converted to block level elements, regardless of what type the element itself,


From baidu
  • Related