LILLY ROBOT |
Property | Values |
---|---|
position | static, fixed, relative, absolute |
right | length, percentage, auto |
left | length, percentage, auto |
top | length, percentage, auto |
bottom | length, percentage, auto |
An element with static positioning is positioned according to the normal flow of the page. The static position is the default for all HTML elements.
Displays
As you can see the bullet points door and mirror are in static position and the flow is normal with the rest of the bullet points.
Relative positioning moves an element from its normal position; the position property along with the positive and negative top and left values are used to move the element.
Displays
For you to have a good understanding of the positive and negative values of top and left, we are going to move the black star away from the center. The outcomes are shown below.
Displays
The black star has moved down and right from its normal position .
Displays
The black star has moved up and left from its normal position.
The absolute position places an element exactly where you want it to be on the page.
Let us place an image called cakes next to the Home link. You have to be careful that you do not throw the image outside the page.
Displays
The fixed position allows you to place an image fixed on the page. The image will stay fixed even if you scroll down the page.
Displays
After scrolling down the star has not moved.
Displays