Based in Omaha, NE, USA
Open prairie hills and the visitor building at Ashfall Fossil Beds in northeast Nebraska

How Do I Change the Font Size in HTML and CSS?

Limited-time savings

Huge Price Drop and Savings!

Great news for Omaha and Nebraska small businesses. Because we have cut our labor costs, every new website with up to 5 pages plus a contact page is now just $300, one time. You get a custom design built by real people you can call, not a template factory, and most sites are ready in 3 to 5 days. Your site is mobile-friendly, has a working contact form and search-ready page titles and descriptions, and comes with a free SSL certificate. Hosting starts at $129 a year for a non-CMS site or $149 a year for WordPress, with daily backups included. Our family team has been building websites in Omaha for over 20 years. Choose what you need in the shopping cart below, call us at 402-813-4034, or send a message with the contact form and we will get started right away.

Get my $300 websiteor call 402-813-4034

A young man and an older woman smiling and laughing together while they look at a new website on a computer
Laptop on a desk showing lines of code while a hand points at the screen, with small and large letter blocks nearby

You change font size with the CSS font-size property. Write it in a style sheet rule or right on the tag, and pick a unit such as px, em or rem. We show both ways below, with code you can copy.

Why font size matters

Different font sizes help you organize your content. They make key words stand out and show your visitors what to read first.

Font size is a basic tool of Omaha web design. A big heading, a medium subheading and normal body text give a page a clear order.

Browsers show body text at 16 pixels unless you change it. That is a good size for reading, so change it with care.

Three letter blocks in small, medium and large sizes lined up to show how font sizes change

Change the font size with a CSS class

The best way is a rule in your style sheet. CSS stands for cascading style sheets. Write a rule for a class like this.

CSS
.my-big-font-paragraph {
  font-size: 28px;
}

Next, add that class to the tag you want to change, for example <p class="my-big-font-paragraph">. Use a class when you want the same size in many places. You change the rule once, and every tag with that class changes too.

Change the font size with inline CSS

You can also write the style right on the tag. This is called inline CSS. It works well for a quick change in one spot.

HTML
<div style="font-size: 28px;">Big Text!</div>

Inline CSS beats the rules in your style sheet, so it is hard to undo later. If you use it on many tags, your HTML gets messy. Keep your font sizes in one style sheet, and your pages stay the same from page to page.

Steps to set a new font size

Follow these steps on any page or theme.

  1. Find your style sheet

    Most sites use a file named style.css. In WordPress, open Appearance > Customize and look for Additional CSS.

  2. Pick the tag or class

    Choose the part of the page you want to change, such as p, h2 or a class name you made.

  3. Add the font-size rule

    Type font-size, a colon, a number with a unit, and a semicolon.

  4. Save and reload the page

    Clear your browser cache if you do not see the change right away.

  5. Check it on a phone

    Open the page on a small screen. Text that looks fine on a desktop can feel too small or too large on a phone.

Which unit should you use?

You can set the size with different units. Pixels (px) give an exact size. Percent (%), em and rem size the text compared to other text.

CSS
body {
  font-size: 100%;
}
h1 {
  font-size: 2em;
}
p {
  font-size: 1rem;
}
.small-note {
  font-size: 14px;
}

The value 150% is one and a half times as large as the text around it. The rule font-size: 2em; makes text twice as large as the text around it. The rem unit is based on the size of the whole page. It stays steady inside nested boxes. We use em and rem for most text. Visitors can still enlarge it in their browser.

Common mistakes

Do not make body text smaller than 14 pixels. Small text is hard to read, especially on a phone.

Check that your rule has a unit. The value 28 alone does nothing in CSS, but 28px works.

If nothing changes, another rule may be winning. Look for an inline style or a rule with the same tag later in the file.

Do not use the font tag from old HTML. It is out of date, and CSS does the job better.

If you have any questions about font-size, or any other HTML questions, call our Omaha web design company at 402-813-4034, or use our contact form.

Rod Atwood, the bearded founder of Websnoogie, beside Tami Atwood, who wears glasses, both smiling

AboutRod and Tami Atwood

Rod and Tami Atwood and other Websnoogie contributors write the Websnoogie blog. Rod has built websites since 2004 and founded Websnoogie, LLC in Omaha in 2012. Tami is co-owner, content editor and billing expert. Call us at 402-813-4034 or write to staff@websnoogie.com.

  • Facebook social media logo
  • X social media logo
  • Instagram social media logo
  • Pinterest social media logo
  • LinkedIn social media logo
  • YouTube social media logo
  • TikTok social media logo
  • Threads social media logo
  • Google Business Profile social media logo

Get started with Websnoogie

A smiling couple at a sunlit office desk reviewing a colorful website on a large monitor

A family company in Omaha

Rod, Tami, and their team have built websites, content, and provided SEO services (internet marketing) for over 20 years. You call us, you talk to us. Most new websites are ready in 3 to 5 days, and our hosting runs at 99.999% uptime.

  • Best of Omaha B2B winner, 2021 to 2025
  • BBB accredited with an A+ rating
  • Small businesses, nonprofits and professionals

Sign up now

Due today$449

Secure checkout through PayPal

More info on our products

Contact us now!

Prefer to talk? Call 402-813-4034 or email staff@websnoogie.com. We are open every day, 7 am to 10 pm.