Thread: Position in CSS
View Single Post
Old 01-11-2013, 03:57 PM   PM User | #3
TFlan
New Coder

 
Join Date: Dec 2012
Location: USA
Posts: 82
Thanks: 3
Thanked 17 Times in 17 Posts
TFlan is an unknown quantity at this point
Above poster has it semi-right..

There are 4 options for the position attribute:
  • Fixed
  • Static
  • Absolute
  • Relative

Fixed positioning is a lot like absolute positioning. The position of the element is calculated in the same way as the absolute model - from the sides of the view port. But fixed elements are then fixed in that location, like a watermark. Everything else on the page will then scroll past that element.

Static is the default position for any element on a Web page. If you don't define the position, it will be static and will display on the screen based on where it is in the HTML document and how it would display inside the normal flow of the document.

Absolute tells the browser that whatever is going to be positioned should be removed from the normal flow of the document and will be placed in an exact location on the page. It won't affect how the elements before it or after it in the HTML are positioned.

Relative positioning is basing the position of the element upon the browser view port, it starts from where the element would be if it were still in the normal flow. (Relative to it's starting, normal position.)
TFlan is offline   Reply With Quote