Search code examples
htmlfontshighlight

My font size is small, but my highlight size is huge?


When I change the font size of some text, the highlight size doesn't change and it's causing gap between the previous lines.

Date highlight size causing gap between the date and title

image 1

<font size = "3"><small>{{blog.pub_date}}</small></font>

Solution

  • It's possible that you have a CSS rule controlling the <small> tag. While <small> would inherit its font-size from the parent <font> tag, if such a rule exists, it will take priority:

    small {
      font-size: 40px;
    }
    <font size="3">
      <small>{{blog.pub_date}}</small>
    </font>

    Also, please note that the <font> tag is obsolete in itself -- you should the use CSS font-size property instead, as is shown in the snippet above.