The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS My first go at clearfixing Not sure if done right

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #45064

    I have my my own grid system with clearfix for my footer have never use clearfix before would like to know if done correct?


    @mwbcomputers, not to bad, i made a few changes and forked it here. Also, check out Chris Coyier’s article about Don’t over think it grids.


    you don’t need the clearfix on each box – just the parent. Perhaps you prefer the modular css and many classes (I don’t), but you can reduce and reuse classes (box 1 and 3 are the same as well as box 2 and 4). I would definitely _not_ use the clearing method John uses above in his fork. There is absolutely no reason to use the universal selector and add garbage to every element on the page. Please know that there a multiple ways of containing floats, and which one you choose will (or should) depend on the situation. The clearfix method is a very good choice most of the time, but I still prefer overflow:hidden.

    Here’s my fork showing how this can be done without a single class (just as a proof of concept)

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.