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-heightspecified (in pixels), but noheight - The child’s
heightis set to100%
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.
Posted in CSS.
Copyright © Roger Johansson