How to change the size of a header in HTML?

Member

by libby , in category: HTML/CSS , 2 years ago

How to change the size of a header in HTML?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by Ekaterina_90 , 2 years ago

@libby  To change the size of your HTML font, use the CSS font-size property.


1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
  </head>
  <body>
    <h1 style="font-size: 100px">My Heading</h1>
  </body>
</html>

Member

by sister , 10 months ago

@libby 

To change the size of a header in HTML, you can use CSS.


Here's an example of how to change the size of an H1 header:

  1. Create a CSS style block in the head section of your HTML document:
1
2
3
4
  
    /* CSS styles */
  


  1. Inside the style block, add a selector for the H1 element:
1
2
3
4
5
6
  
    h1 {
      /* CSS styles */
    }
  


  1. Add a style rule to set the font size:
1
2
3
4
5
6
  
    h1 {
      font-size: 30px;
    }
  


This will set the font size of all H1 headers to 30 pixels. You can adjust the number to change the size to suit your needs.