So after changing the position of a div using transform translate, the parent div does not resize accordingly to fill the white space. Any advice would be appreciated.
<script src="https://cdn.tailwindcss.com"></script>
<p>
Distance from top
</p>
<section>
<div >
<div >
<div >
<p>Lorum ipsum !</p>
</div>
<div >
<p>Lorum ipsum !</p>
</div>
<div >
<p>Lorum ipsum !</p>
</div>
</div>
</div>
</section>
<p>
Distance from bottom
</p>
CodePudding user response:
❌ I tried the
translateway but not work,❌ I tried the
positionway and still doesn't work.✅ but with the negative
margintrick, is working!
-mt-16,-mt-32class solve it,
mtmeansmargin-topin plain CSS
and if you add-prefix, means negative value.and that it, solved!
<script src="https://cdn.tailwindcss.com"></script>
<p>
Distance from top
</p>
<section>
<div >
<div >
<div >
<p>Lorum ipsum !</p>
</div>
<div >
<p>Lorum ipsum !</p>
</div>
<div >
<p>Lorum ipsum !</p>
</div>
</div>
</div>
</section>
<p>
Distance from bottom
</p>
if there is a space between the text and content is because of the
containerclass, but is solved. (seeDistance from bottomtext in your example and in my mine, huge improvement)
