so I want to scale a div down, but when I do that, it still takes up the same amount of space, but there is just whitespace instead, and then it is small in the middle.
But I want it to actually take up less space, and allow the elements above and below to be closer to it.
Heres an example of the problem: HTML:
<h1>A title goes here</h1>
<div>
<span>Some text here</span><br>
<span>Some text here</span><br>
<span>Some text here</span><br>
<span>Some text here</span><br>
<span>Some text here</span><br>
<span>Some text here</span><br>
</div>
<p>And some more text here</p>
CSS:
div{
width: fit-content;
transform: scale(0.5);
}
Codepen: