<font size ="10">font size 10</font></br>
<font size ="9">font size 9</font></br>
<font size ="8">font size 8</font></br>
<font size ="7">font size 7</font></br>
<font size ="6">font size 6</font></br>
<font size ="5">font size 5</font></br>
<font size ="4">font size 4</font></br>
<font size ="3">font size 3</font></br>
<font size ="2">font size 2</font></br>
<font size ="1">font size 1</font></br>


What's wrong with my code?


1 Answer 1



The <font> tag's size property is only defined for values of 1 through 7. MDN says about the <font> tag:


This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

and later:

[...] For any new web development, styling should be written using CSS only.


Use the style property of HTML tags and CSS styling.

<span style="font-size:84">font size 10</span></br>
<span style="font-size:72">font size 9</span></br>
<span style="font-size:60">font size 8</span></br>
<span style="font-size:48">font size 7</span></br>
<span style="font-size:36">font size 6</span></br>
<span style="font-size:24">font size 5</span></br>
<span style="font-size:18">font size 4</span></br>
<span style="font-size:16">font size 3</span></br>
<span style="font-size:12">font size 2</span></br>
<span style="font-size:8">font size 1</span></br>

different font sizes in QGIS layout composer / HTML layout

  • 1
    Thank you, @Stefan. This really helps my work. :)
    – BallpenMan
    Commented Mar 24, 2020 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.