doorman doorman - 2 months ago 16
CSS Question

Child/parent inheritance

I have a child element that needs to inherit the height of a parent element way up the element tree. Is there a way to tell the child element to inherit a property from another element without specifying it for all parent levels up the tree?

Answer

The answer in short: No; it is not possible.

Only inheritable properties (some actually can't be) can be passed from parents to children.

From your question: "Is there a way to tell the child element to inherit a property from another element WITHOUT specifying it for all parent levels up the tree?":

Take it as: without specification = no legal relation (to inherit a property as in a day to day reality).

In actual sense, only the <html> element cannot inherit a property.

All others need to be reference where appropriate and such properties must be inreritable for the transfer to be successful.

... more details.