2 mins read

5 Ways to Change the Size of Your Header in CSS

Last Updated on 2 years by sonnysuman

One of the most important parts of your website design is its header. Whether you’re incorporating text, images, logos, or simply using it as an extension of your branding, your header’s size should be tailored to fit your page. Here are five ways to how to change size of header in css!

1) Increase font-size

The easiest way to change the size of your header is by adjusting the font-size in your CSS. By default, you’ll want to use one of two units: points or pixels. Points is an older unit, but it’s a standard that most designers and developers have used since 1999.

2) Increase line height

You can change the size and weight of your text with line height. Line height is a measurement that describes how far apart lines are from each other. It can be changed with this CSS code:

body { line-height: 140%; }

The values of line-height should be set in percentage points and not a number, so it\’s 100% by default.

3) Use padding instead of margin

This will set up padding that\’s relative to each other, meaning that it\’ll grow or shrink depending on how much padding you want. Let\’s look at a few quick examples:

4) Increase font family

.h1 {font-family: Georgia, serif;}

## .h2 {font-family: Georgia, serif;}

## .h3 {font-family: Georgia, serif;

5) Use em units (if supported by browser)

One way to change your header size is by changing the font size with em units. This is a tricky way because what you will find is that if you change your font size from 16px, for example, down to 12px, all the content on your page will adjust accordingly – so it\’s worth taking a few measurements first. Another common technique is decreasing or increasing the padding/margin (or both) until you\’re happy with how big the text appears.

Related searches
how to adjust header image size in html
html header size
how to change font-size in css
width and height css
css image size scale to fit
header css
width in css
css height vh

Leave a Reply

Your email address will not be published. Required fields are marked *