Absolute in css and importance in the interface
This article I wrote a brief and easy to understand for you to understand what is absolute?
To design the interface you use margin padding, but it is easy to broken interface, if this component is to dominate over other components, it will fall and broken right interface.
A component offers the absolute property is that it has more properties top, left, right and botom. You only need to use this attribute to locate it, you only need to use one pair of attributes only, top and right, or top and left … alignment position at the top and left position, it looks like only the coordinates.
To determine the coordinates for an absolute component, it must identify mold from somewhere, right? it will get the closest father brought relative attributes. If no component wear properties relative, it will get the highest component is the body as a standard, that is taken in the upper left corner of your screen.
Brought under the absolute components used are very popular, it is used to format the components is easy, just fill in the coordinates is done, the components can be stacked, these components dominate over other components is not an interface, it just overlap.
Another place is the component carries absolute attribute with another attribute z-index, ie the number of stacking priority, component z-index greater than when located general, the composition of which will be located on the (new required attribute absolute use z-index attribute).
This is a code example for your reference
this is the css code
#wraper{
position:relative;
text-align:center;
width:500px;
height:500px;
}
.hinh{
width:300px;
height:300px;
position:relative;
}
.hinh img{
position: absolute;
top: 50px;
left: 50px;
width: 200px;
height: 200px;
}
TV card in this example will find components father brought under the nearest relative to a standard, which was a significant component class is configured. It will watch for this component is about in on the left is 50px and 50px.
For example, components Network class not bring relative attributes, it will take components bring standard id wraper do for guarding position. If this component does not carry this attribute, it will get the body ready to guard and take the position.
Absolute does not depend on its composition contains component that depends on the temporal properties closest relative.