-2

I know the float property is not recommended for placing blocks within a page, but couldn't find any good explanation for why I shouldn't use it. I know it wasn't designed for this in the first place, but as long as it works, why shouldn't I use float positionning to layout my blocks ?

Magix
  • 4,989
  • 7
  • 26
  • 50

1 Answers1

2

float is a very hacky solution. It's original design is to wrap text around an image and when used for blocks presents issues by not having that block in the page flow and requiring a clearfix, removing all hope of semantic design for that block without using shadow dom, making display:inline-block; a much more elegant and useful solution.

  • [The question in your link](http://stackoverflow.com/questions/15172520/) asks why inline-block is better than float, not why float shouldn't be used. I don't think this question has an answer there. – Magix Apr 01 '17 at 21:53
  • 1
    @Magix It still presents some reasons not to use it however I will summarize it instead of linking. – TheFarmingBunny Apr 01 '17 at 21:56
  • 1
    @Magix I have updated my answer to hopefully answer the question – TheFarmingBunny Apr 01 '17 at 22:04