SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Which is considered best practice, floated or positioned layouts?

    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?

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,633
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    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.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,633
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    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.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  5. #5
    SitePoint Zealot behati's Avatar
    Join Date
    Feb 2012
    Location
    Copenhagen, Denmark
    Posts
    152
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Float all the way! Your coworkers owe you a beer

  6. #6
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Allright! Allright! I sure could use that beer. I'll show those guys this thread.

  7. #7
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,806
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    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)

  8. #8
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My opinion? Excellent points. Well thought out.
    It's late here. More later.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •