Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to change font size using CSS ?

  • Difficulty Level : Medium
  • Last Updated : 25 Mar, 2021

The purpose of this article is to change font-size using CSS.

The font-size CSS property sets the size of the font. There are several ways to specify the font size, including keywords or numerical values for pixels or ems. Choose the appropriate method based on the needs of the particular web page. 

Syntax :

font-size: medium|xx-small|x-small|small|large|x-large



<!DOCTYPE html>
      .div1 {
        font-size: 1.2em;
      .div2 {
        font-size: smaller;
      .div3 {
        font-size: 80%;
      .div4 {
        font-size: 12px;
      .div5 {
        font-size: x-small;
    <div class="div1">GeeksforGeeks</div>
    <div class="div2">GeeksforGeeks</div>
    <div class="div3">GeeksforGeeks</div>
    <div class="div4">GeeksforGeeks</div>
    <div class="div5">GeeksforGeeks</div>


different font size 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!