CSS Height: 100% Vs Height: Inherit
Answer :
height: 100%
will match the height of the element's parent, regardless of the parent's height value.
height: inherit
will, as the name implies, inherit the value from it's parent. If the parent's value is height: 50%
, then the child will also be 50% of the height of it's parent. If the parent's size is defined in absolute values (e.g. height: 50px
), then height: inherit
and height: 100%
will have the same behaviour for the child.
Comments
Post a Comment