I found the following code:
<div xmlns="http://www.w3.org/1999/xhtml"
style="z-index: 1; position: absolute; top: 90px; left: 90px; background: none repeat scroll 0% 0% black; width: 800px;"
id="mainDiv">
<div style="width: 405px;" class="floatLeft" id="mainDiv3">
<div style="width: 100%;" id="mainDiv31">
<div style="width: 107px; height: 100%;" class="floatLeft"
id="mainDiv313"></div>
<div
style="width: 2px; height: inherit; background-color: white; cursor: default;"
class="floatLeft" id="mainDiv31_vertical"></div>
<div style="width: 296px; height: 100%;" class="floatLeft"
id="mainDiv314"></div>
</div>
<div
style="height: 2px; width: 100%; background-color: white; cursor: default;"
id="mainDiv3_horizontal"></div>
<div style="height: 311px; width: 100%;" id="mainDiv32"></div>
</div>
<div
style="width: 2px; height: inherit; background-color: white; cursor: default;"
class="floatLeft" id="mainDiv_vertical"></div>
<div style="width: 393px;" class="floatLeft" id="mainDiv4">
<div style="height: 456px; width: 100%;" id="mainDiv41"></div>
<div
style="height: 2px; width: 100%; background-color: white; cursor: default;"
id="mainDiv4_horizontal"></div>
<div style="height: 142px; width: 100%;" id="mainDiv42"></div>
</div>
</div>
Now, I am looking to dynamically adjust the height of elements with ids ending in _vertical
based on their parent's height. This adjustment should occur automatically when new content is added to the parent div.
For instance:
If content is added to mainDiv313
, causing an increase in the height of its parent mainDiv31
, then the height of mainDiv31_vertical
should also adjust accordingly.
Is there a CSS property that can be assigned to the height of mainDiv31_vertical
to achieve this behavior without relying on JavaScript or jQuery for processing overhead?
I have set it to inherit
as a starting point to inherit the height from its parent.
Your suggestions are appreciated.
UPDATE
I am aiming for something like
div1 -->div11
>div1_vertical
>div12
This indicates that div1
contains these 3 other divs within it. When the height of div11
changes, the height of div1_vertical
should adapt automatically without requiring JS or jQuery. I am seeking a CSS solution given that no specific height is defined for div1 so that it adjusts with its children.