Chapter 7: Layers and float styles
As seen in previous chapter on position, the position of an element can be controlled by the position style.
What happens, when the position of elements is changed in such a way that they begin to overlap?
Consider the following two divs:
If the below one is moved up using position:relative; top:-20px; left:100px, we get the following:
To allow the red div to overlap, z-index style is used (along with the position style).
An element with higher z-index is displayed over an element with smaller z-index.
Float style enables the floated element to appear embedded inside the other element.
Without float, the above would looked as:
Float can have only two options: float:left or float:right
|Email:||(Your email is not shared with anybody)|