4 ms·
Just a little correction: percentage values are computed based on the element's _containing block_, not parent. Most of the time, an element's containing block
by DecayingOrganic 5y ago
Just a little correction: percentage values are computed based on the element's _containing block_, not parent.
Most of the time, an element's containing block is its parent, but not always.
For more on this: https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_...
- varrock 5y agoI found the rule about absolutely positioned elements interesting given that I often thought their containing block was the closest relatively positioned parent. As outlined in that documentation, though, it's just the closest element that is not statically positioned.
- christophilus 5y agoOh, wow. That explains a few baffling bugs I’ve seen.