CSS HTML element positioning 

Joined:
01/02/2012
Posts:
9

January 26, 2012 20:37:45    Last update: January 26, 2012 20:37:45
There are 4 positioning styles in CSS:
  1. static: this is the default positioning style. Elements are positioned according to the normal flow of the page.
  2. fixed: the element position is fixed relative to the browser window, i.e., when you scroll, the element does not move with other contents in the page.
  3. relative: the element is positioned relative to its normal position (i.e., static position). You can use relative positioning to offset an element from its normal position. Other elements are positioned as if the relative positioned element were in its normal position.
  4. absolute: the element is positioned relative to the first ancestor element that is not static positioned. If all ancestor elements are static positioned, the element is positioned relative to <html>. Other elements are positioned as if the absolute positioned element were not there.
Share |
| Comment  | Tags