html css font size code example

Example 1: how to change font size in html

<body>      
         <h1 style="color:red;font-size:40px;">Heading</h1>      
         <p style="color:blue;font-size:18px;">This is demo text</p>    
      </body>

Example 2: font size css

.class {
	font-size: 12px;
}

Example 3: html font size

<span style="font-size:20px;"></span>

Example 4: css font-size

#selector{
    font-size:20px;
}

Example 5: html font size

font-size:20px;

"default size is : +-16px;"

Example 6: css font size

// to scale font size in relation to its parent element
style="font-size: 2vw;"

Tags:

Html Example