I want a div to go inside another div even if it is somewhere else.how can I do this ?
<div id="main">
</div>
<div id="sub">
</div>
How can I put the div “sub” inside the div “main” without actually writing the div “sub” inside “main”.But I want to do this in a relative manner so that if the content of the sub increase the main also increases.Is there any way to do this ?
I don’t know about css but this may be helpful to you. You can achieve this by creating a JQuery function with variables as height and width of the div elements (as well as positioning). Keep those variables in relation so that whenever the div elements are resized or changed there respective div elements will change. Thus the sub div element will act as a child div.
For example: