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

Home Forums CSS Vertical aligning divs in li's? Reply To: Vertical aligning divs in li's?


You have the li as display:table when, I feel, they should be display:table-cell

Is there any reason why you can’t just give #box a 20px top margin?

Only that you are committing yourself to hard-coding something that you might have to change later if the height of the cell changes.

Avoiding fixed px values should avoided IMO for proper responsiveness if other, more flexible/dynamic, options are available.

It’s probably not something you can always avoid…but this is certainly one instance where you can.