View Single Post
Old 12-09-2012, 03:51 PM   PM User | #4
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
The answer is: "it depends"! Here is a good article to read.

But to attempt to summarise..in VERY broad terms:

(always) give 1st preference to "static";
consider "float" to achieve desired layout or, for example, to float images within a larger textual-area;
then "relative", but mainly to supply a content for "absolute" and other positioned elements;
avoid "absolute" but, if used, tend to do so in the context of another (relatively) positioned element;
"fixed" is used rarely, but occasionally is used to fix a small element at one side of the browser window.

Specific layouts are mainly achieved using floats, but some layouts can also be achieved with a combination of relative and absolute positioning. Percentage and/or fixed widths on elements are also used to achieve a desired layout and behaviour. cf liquid layouts.

People sometimes resort to positioning of elements when they haven't fully explored the use of margins and padding to separate elements.

And avoid DIVITIS!

I may have confused rather than helped?? but the links are good
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
AndrewGSW is offline   Reply With Quote