'CSS Section height adapt to inner object

I'm trying to adjust the height of a "section" when the inner "div" of another "box" unfolds without changing the height of the "box" itself. Is it possible to make a relation between a inner>inner div and the outer section height with CSS? Problem, visually represented

Section (height should adapt with "fold out DIV2") DIV1 (height should remain) DIV2 (folds out)

Sections CSS Code:

element.style {
}
#section-739-164 {
    height: 100%;
    min-height: 500px;
}
.position_relative {
    height: 100%;
    position: relative;
}
.bg {
    selector-locked: false;
    text-align: center;
    margin-bottom: 0;
}
.bg {
    color: #333;
}
.ct-section {
    width: 100%;
    background-size: cover;
    background-repeat: repeat;
}
article, aside, details, figcaption, figure, footer, header, main, menu, nav, section {
    display: block;
}
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
*, ::after, ::before {
    box-sizing: inherit;
}
user agent stylesheet
section {
    display: block;
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source