Could anyone assist me in figuring out how to adjust the height (red border) to fit the content (green border)?
https://i.sstatic.net/l1p9q.png
I'm struggling to determine which property to use, I'm aiming for this outcome but haven't had any luck so far
https://i.sstatic.net/YEakI.png
div.items {
position: fixed;
top: 7.4cm;
left: 1cm;
width: 19.6cm;
height: 4.5cm;
border: 1px solid black;
}
div.item {
border: 1px solid red;
height: 19px;
}
div.cantidades {
position: absolute;
left: 0.1cm;
width: 1.6cm;
}
div.descripcion {
position: absolute;
left: 1.9cm;
width: 10.5cm;
}
div.precioUnitario {
position: absolute;
left: 12.4cm;
width: 1.5cm;
}
div.ventas {
position: absolute;
left: 17.4cm;
width: 2.2cm;
}
div.green {
border: 1px solid green;
}
<div class="items">
<div class="item">
<div class="cantidades">2</div>
<div class="descripcion">TM. MAIZ AMARILLO DE MUELLE DE CEPA HACIA BODEGAS DE ALMAPAC</div>
<div class="precioUnitario">$1.60</div>
<div class="ventas">$60</div>
</div>
<div class="item">
<div class="cantidades">2</div>
<div class="descripcion">TM. MAIZ blanco</div>
<div class="precioUnitario">$1.90</div>
<div class="ventas">$6</div>
</div>
</div>