HTML & CSS
I just started a new job and am already trying to settle an argument. I've been using completely floated layouts, measured in ems, for the last 7 or 8 years. I started using floated layouts because I read somewhere that they were considered best practice. Others at work are saying that both positioned and floated layouts are best practice.
Can anyone point me to a source or document that discusses this?
You are correct in this matter. If you google "floats vs position" you will find a number of arguments, 99% of which I'd be willing to bet choose float.
Here is one such discussion which targets some main points.
Thanks Ryan. I googled several different combinations of terms (float, position, best practice, etc.) before I posted, but didn't find anything definitive. "floats vs position" returns some other resources that I didn't find before, and, as you said, everything seems to point to floated layouts as the preferred method.
Although many of the current resources also seem to advocate absolute positioning (in some instances) within floated layouts. I've never used any positioning in my floated layouts. I think I end up just adding additional containers to handle situations in which absolute positioning might be useful.
Absolute/relative positioning does have its place in web design. However it's not meant for big chunks of the layout.
An example use would be to place some images in the corners of an element (such as rounded corners or a shadow). There are many uses for it but it just has so many negative side effects to be any sort of productive use as a layout tool.
Float all the way! Your coworkers owe you a beer
Allright! Allright! I sure could use that beer. I'll show those guys this thread.
It's really a bad idea to paint yourself in one or the other. I know it's tempting because it would be simpler and also because "client speak" often comes from a "camped" direction. But remember clients usually DONT KNOW much about this stuff... or worse they know buzz words.
Really Bruce Lee had the best philosophy , apply what is useful.
I like to base myself on the following points, which you may already know:
1) There is/was better support for floats than AP/RP for quite a while. This is not so much of a issue today, but as you should strive for your pages to support as many browsers and versions it is something I consider. Seriously if it wasn't for browser support... display:inline-block/-moz-inline box does wonders.
2) AP really takes element out of the flow.. so its difficult to build in such a way were layout elements interact with each other.
3) More importantly, AP causes a mentality designer/client thing in size and position instead of flow and flexibility. It really lends to the WYSIWYG mentally which should be avoided like the plague.
4) HOWEVER for some things, depending on the specific application, AP/RP is a life and bandwidth saver. (again taking into consideration browser support)
My opinion? Excellent points. Well thought out.
It's late here. More later.
This topic is now closed. New replies are no longer allowed.