Trusted answers to developer questions

How to change the font size in HTML

Get the Learn to Code Starter Pack

Break into tech with the logic & computer science skills you’d learn in a bootcamp or university — at a fraction of the cost. Educative's hand-on curriculum is perfect for new learners hoping to launch a career.

widget

Font size in HTML

In HTML the method of changing a font size is pretty simple and easy. All you have to do is include the tag in the code snippet below.

  • HTML

The size number must be in " ". However, keep in mind that this only works for versions before HTML 5. Let’s look at an example before we move on to changing font sizes in HTML 5.

  • HTML

Font size in HTML 5 and onwards

In HTML 5 the syntax changes. For this, the font size is changed using the CSS font-size property where the tag changes slightly. This is shown in the code snippet below.

  • HTML

Let’s look at an example below to better understand this.

  • HTML

RELATED TAGS

html
css
font size
font-size
Copyright ©2024 Educative, Inc. All rights reserved
Did you find this helpful?