Forums

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

Home Forums CSS CSS float problem Reply To: CSS float problem

#237678
Atelierbram
Participant

I like the way this image-gallery is responsive with using viewport-units, works well I think. Don’t know exactly if this is what you mean, but anyway; when the h4.year should always stick to the most left-side, then it makes sense to clear everything that came before.

h4.year {
  /* stuff */
  clear: left;
}

Alternatively, one could use nth-child selectors in mediaqueries, to clear floats after “a certain number of elements“.