Use the knowledge to understand the dimensions of CSS positioning properties

We know there are HTML conventional and unconventional flow text flow, when a position attribute of the element for the relative positioning, absolute positioning or fixed positioning when the normal flow of text, this element will be out, this time you can use the left and other attributes set location.

To understand this process principle is very simple, we can use the dimensions of thinking to understand.

We all know that two of the VV is a flat dimension, three dimension is that we now live in the real world, then we can put a page is viewed as a two-dimensional plane dimension, this dimension is the contents of the order, For example, you're writing an article, suddenly found the need to put in a word in front of it in front of that paragraph, then you will need to delete this sentence, after the exchange of the order, write once, HTML is also the same, but when we after this element to set the positioning property, let it flow out of the routine, this time out of this element is the equivalent of a two-dimensional planar dimension of the world, came to the three-dimensional three-dimensional world, this natural element can in this two-dimensional planar dimension casual mobile world, without the need to rewrite code. And based on this stacked relationship you can also use this approach to understanding, for example, a pen that we can put it on top of a piece of paper, that the pen is higher than the level of the hierarchy this piece of paper, then on to us from next thing you see is this pen, when we put pen to paper on this below, that is, the pen's level lower than the level of this paper, we first see from top to bottom It is this piece of paper, rather than a pen.

Guess you like

Origin www.cnblogs.com/Michaelcat/p/11129519.html