I have a parent div "d1" and it contains a child div "d2". d2's visibility changes every time a particular button is clicked. What I need is to wrap d1 around its other contents when d2 is hidden and expand when d2 is visible.
Its something like this:
<p>Content which is visible all the time</p>
<button onclick="changed2()">Alter d2 visibility</button>
<div id="d2" style="visibility:hidden;">
display: block instead of using
visibility: hidden and
display:none will hide the element completely and its space.