I have a requirement where I have to increase the container length of div-a automatically based on the size of div B(which dynamically increases or decreases based on the input or questions we answer).
Currently, its handed through the min-height set on the container.
You may write custom styles in Userworkform (OOTB HTML fragment) making height as 100%, you don't need to explicitly mention the height based on other div. height:100% will shrink the div element based on the content.
If you want to restrict to a certain height and then have scroll bar, you may fix the height of Parent element in the same userworkform.