Edinburgh-Genome-Foundry / blabel

:label: Python label/sticker PDF generation. HTML templates, built-in barcodes, qr codes, and other goodies
https://edinburgh-genome-foundry.github.io/blabel
MIT License
179 stars 38 forks source link

Help making a label with a "title" and "description #14

Closed W-M-D closed 3 years ago

W-M-D commented 3 years ago

I've tried using "<\h1>" or changing the type in CSS but nothing seems to work. I just want two different text elements that have different sizes. Any one know what to do ?

veghp commented 3 years ago

Hi, the span tag works for me:

Template:

<div><span class='small'> Small text </span><br></div>
<span class='big'> Made with blabel <br></span>

CSS

.small {
  font-family: Verdana;
  font-weight: bold;
  vertical-align: middle;
  display: inline-block;
  font-size: 10px;
}
.big {
  font-family: Verdana;
  font-weight: bold;
  vertical-align: middle;
  display: inline-block;
  font-size: 30px;

example.pdf

Also works with the div element:

#small_text
{
    font-size: 10px;
    margin-bottom: 0.2mm;
    width: 25mm;
}