Height in percent when parent has min-height and no height

When trying to force an element to always extend to the height of its parent I ran into some peculiar browser behaviour that I thought was worth mentioning. Here’s the situation:

  • The parent element has a min-height specified (in pixels), but no height
  • The child’s height is set to 100%

I was expecting the child to get the same height as its parent, but that is not what happens. What happens instead may well be according to the CSS 2.1 Specification, but a bit unintuitive, at least to me.

Read full post

Posted in .

Copyright © Roger Johansson

This entry was posted in Blog. Bookmark the permalink.