I have a REALLY BASIC question regarding nested divs and height inheritance. Let’s say I have the following html snippit:
...
<div style="height: 50px;">
<div style="height: inherit;">
</div>
</div>
...
I would think just by inspection that the inner div would have the same height (50px) as the outer one but when I tested it the height was not inherited.
First off, are parent/child relationships betwen divs defined by nesting one within the other? Next, what do I need to do to make the inner div inherit the outer one?
Sorry guys for such a basic question. I am running on fumes here been working (on something else for hours and I have to switch gears to this). Please don’t bash me for asking such a dumb question. 🙂
Thanks!
If you are not able to
inheritheight of parentdivuseheight: 100%;forinnerdivDemo
And btw your div does inherit height, it’s just that if you want to see give it a
background-coloror aborderand you’ll see the inner div has inherited the height of it’s parent divDemo 2