Is it good to use float in table less design? What is the pros/cons of float in the context of table less cross browser compatible design? Is there any the best practices guidelines for cross browser compatible tableless design?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is a bit like asking “should I use arrays?”. The answer in both cases is “it depends (on what you’re trying to achive)”.
Floats are not only useful, backwards compatible and arguably necessary (with or without tables) but that’s not really the point. You use them because it allows you to achieve the desired results.
Like everything they have strengths and weaknesses. Most notably, floats work best with fixed width content. Having the float be as wide as it needs to be tends to be where such layouts fall down.
Edit: in relation to the comment regarding IE treating them differently, two rules of thumb apply:
DOCTYPEon your documents. This forces IE from “quirks” to “standards compliant” mode (both euphemisms); andThat being said, you still have to test your pages in the major browsers but in my experience it’s not that difficult to write something out of the box that mostly works on all browsers and simply needs to be tweaked after the fact.