0
I’m trying to put together an HTML page to print a label with 80mm x 40mm. It’s working, but when the person’s name is too big the label loses alignment, consuming 2 labels.
I need to lock in the size of the div, and if the text is larger it has to be summarized and does not change the size of it.
Example of code working:
<div style="page-break-inside: avoid; width: 80mm; height: 40mm; background: #ccc;">
<!-- Nome Cliente -->
<div style="page-break-inside: avoid;">
<b>RAFAEL VILELA</b>
</div>
<!-- Endereço -->
<div style="text-align: left; font-size: 10px;">
BOA ESPERANÇA - MG<br> RUA SÃO TIAGO - 298
</div>
<!-- Volumes -->
<div style="height: 15mm; text-align: center; line-height: 15mm; font-size: 18px;">
<b>Vol.: 1 / 3</b>
</div>
<!-- Nome Cliente -->
<div style="text-align: left; font-size: 8px;">
CON. JOÃO ALGUSTO<br> 19/10/2018 - (11:20)
</div>
</div>
Now an example of how it gets misaligned with the big name.
<div style="page-break-inside: avoid; width: 80mm; height: 40mm; background: #ccc;">
<!-- Nome Cliente -->
<div style="page-break-inside: avoid;">
<b>RAFAEL VILELA FARIA BORGES DE ALMEIDA TESTE NOME GRANDE</b>
</div>
<!-- Endereço -->
<div style="text-align: left; font-size: 10px;">
BOA ESPERANÇA - MG<br> RUA SÃO TIAGO - 298
</div>
<!-- Volumes -->
<div style="height: 15mm; text-align: center; line-height: 15mm; font-size: 18px;">
<b>Vol.: 1 / 3</b>
</div>
<!-- Nome Cliente -->
<div style="text-align: left; font-size: 8px;">
CON. JOÃO ALGUSTO<br> 19/10/2018 - (11:20)
</div>
</div>
Hello Hugo Borges, css has to be online or has some external css file?
– Phill
May be external.
– Hugo Borges