Your complete guide to HTML fonts (or Web Fonts)

Sep 26, 2022
HTML fonts, featured image, illustration.

If you're looking for one aspect essential to your website's branding and design, it might be the font. The right typefaces is a way to convey personality, makes longer text sections more readable, and establish your name in the minds of visitors.

Where can you get Web fonts? Which fonts work with HTML, and which are "web safe" and can be used for any site? We'll explore them all in this piece.

Let's begin!

HTML Fonts What are Web Fonts?

Typefaces have a rich history, but fonts, as they are used today became popular with the rise of computers as well as the internet. Digital fonts needed special treatment to render on screens. When different sizes of screens and devices came into play the situation only became more complex.

Google Fonts homepage showing the most popular web fonts
Google Fonts are a collection of trendy web fonts

In the realm of digital fonts, there are various kinds. Some fonts are intended primarily for graphic and print design. They tend to be huge and unsuitable for websites However, they're perfect to create graphics. There are also "web secure" fonts, which can be found in the majority of computers.

There are some aspects that distinguish web fonts from the standard desktop font. One of them is that they can't be used with programs installed on your PC; instead, they have to be uploaded to a server and used on the web.

Web fonts aren't with your customers' devices There are specific ways to display them in a way that everyone who comes to your website can see them.

You may download the fonts as normal and upload them onto your server, or you can use the web-based font hosting service to embed the fonts on your website without the need for a download.

What Fonts Are You able to Use for HTML?

Certain fonts shouldn't be used on the web However, what fonts are able to be added to your HTML web page?

In essence, you are able to utilize any font that you download to display on your site. The only thing you have to do is upload the font and make it work properly. Then, it will appear on your site.

Scribble font example
The Scribble font doesn't work well on webpages

While you are technically able to apply any font to your website, it's not always the best idea. It is best to look for web fontsand not ones that are designed to be used in print or graphic design. Some fonts are so stylized or intended for such huge font sizes that they will not be able to render correctly on your site. With a web font, this isn't a concern.

There are also licensing issues to consider when using desktop fonts for your website (or making use of web fonts to print design). If you use a font on a different medium than that you bought it from could result in a problem. Be sure to check your license thoroughly before buying it.

You can also seek out specific hosts that permit you to use a simple call in the HTML to show their fonts on your own website through either free or paid plans.

  • TTF
  • OTF
  • WOFF/WOFF2
  • SVG
  • EOT

When you have these font file types that you can then to apply it across your site , and then style it using HTML and CSS.

There are also web safe fonts, which typically work universally across the various browsers and software.

What Are Web Safe Fonts?

Arial font example
Arial is a common web safe font

If all you're worried about is maximizing performance and absolutely making sure that your website shows fonts in a correct manner, Web safe fonts can help those.

Here is a list of internet safe fonts that are generally okay to make use of.

  • Arial
  • Brush Script MT
  • Comic Sans
  • Courier New
  • Garamond
  • Georgia
  • Helvetica
  • Impact
  • Lucida Console
  • Palatino
  • Tahoma
  • Times New Roman
  • Trebuchet MS
  • Verdana

Of all of them, Arial, Times New Roman, Helvetica, and Courier New are the safest. Although they are considered safe for use on the web however, the other fonts do not work with specific operating systems.

If you're not running something like a government site or a simple web-based information website, it's probably unnecessary to compromise your branding by avoiding most fonts. Fonts for websites that are web safe are readable however they're too common and frequently used.

It's better to select an attractive, distinctive set of fonts you can apply to your site, especially since there's a solution to the issue of web fonts failing to load using Fonts that fallback.

A Note on Font Stacks

Font stacks, sometimes referred to as fallback fonts are the primary reason for using the most creative and bold web fonts.

Thanks to Fallback Fonts that are available, it is easy to install a safe web font in case something goes off. It works by choosing a font the user has installed, based on type family:

  • Serif fonts are defined using small strokes attached to the ends of the letters lines. They are considered to be elegant and are easily read.
  • Sans Serif fonts are created in a similar way as serif fonts however they lack strokes. They're simpler and easier accessible.
  • Fonts that are monospace are evenly spaced between every letter. This gives their own distinct look.
  • Cursive fonts (or Script fonts) depict formal, handwritten letters. They are not very legible and work better as headings or graphic design.
  • Fantasy fonts (or Decorative fonts) are very stylized and, like cursive fonts, aren't suitable for use as body text.

Make sure to remember that font stacks actually the definition of a "stack"; it is quite possible to include multiple fallback fonts in sequence. Make sure that you include a safe web font at the end of the stack. This way, there's still a chance to promote your brand by using the same font should your primary one doesn't work.

How to Add Fonts With HTML

If you want to add an online font on your website, there are a few choices.

To WordPress people, the easiest way to get fonts onto your site is through a plugin. The two most popular ones are Simple Google Fonts and Use Any Font. This one makes it easier of installing Google Fonts to your website, while UAF allows you to download fonts on your site directly.

If you don't have WordPress or do not want to rely on a plugin, the process may require manual tweaking.

Luckily, this is very easy to do provided you've got a properly configured web font. Simply upload the files onto your server, then use the @font-face rule in the stylesheet that defines it. For example:


 @font-face 
 
 font-family: FontName;
 
 src: url(FontLocationOnServer);
 
 

After that, you can utilize your font-family tag to reference your font wherever you want it to be in an HTML document.

CSS and HTML to style fonts. CSS

Notice: If you worked with older HTML versions, you might remember the "font>" tag. This is no longer supported and shouldn't be used. Instead, you can create a styled text using CSS or with an HTML styling element.

The first step is to modify the font by using colors. It is possible to use an RGB code, a color name such as "red," an RGB code, or a HEX value. This is set with the property of color. property like so:

 P color: blue
 

or as an individual HTML Style element


 Text.
 

Background color is exactly the same as the background color, however it uses the color attribute for background.

"p" background-color blue;

Next next is font size. This can either be in pixels, percentages, or Ems (which can be useful for creating responsive sites).

p 
 
 font-size: 16px;
 
 

Or:

Text.
font size CSS
Setting the font size using CSS

Then there are font style and weight. Or italics and bold. If you want to use slanted text, make use of"italic" tag "italic" tag.

.italic Italic font style;and for bold: Bold .bold Font-weight: bold.
font style CSS
Set the font's style with CSS.

Additionally, you can make use of HTML tags in place of HTML. For italics, you can make use of:

to a message that communicates emphasis, or use:

  

for a text that is designed to stand out visually.

And for bold, use:

(b>)

For example:

  Bold Text  

or

It is of special significance.

Where to Get HTML Fonts?

If you're looking to utilize an external font hosting service or download them, it is important be aware of the top locations to download fonts. There are many distributors out there, but there are a few that are considered as trustworthy sources for fonts. These are the ones we recommend:

  • Google Fonts is one of the best sites to find fonts. Why? They are easy to integrate in your website without having to download them, their selection is vast and beautiful And, most important of all the fact that they are cost-free. Google servers are constantly fast therefore you can rely on their ability to provide the fonts in as short a time as is possible.
google fonts
Google Fonts
  • Adobe Fonts offers hundreds of fonts for any Creative Cloud subscriptions. With other services (that don't rely on open-source fonts, like Google Fonts and Google Fonts, for instance), you often need to be concerned with licensing. Fonts that are licensed can be used to use on any type of project, personal or commercial.
  • Fonts.com has a numerous fonts available to use on both the desktop and for internet use. They will provide you with the necessary code to get it on your site. The issue is there is a variety of licenses available which can prove somewhat difficult to understand. It is possible to pay based on either a one-time fee or a pay-as you-go system.
  • TypeNetwork offers high-quality fonts for serious projects and offers a range of licensing options. Get fonts on desktops apps, websites, or ePub. Web fonts are also available with an additional choice: Self-hosted or hosted.
  • Before Google Fonts ever existed, Font Squirrel was the place to find free, commercially-licensed fonts for use in any project. There's a wide selection, but sadly there is no option for font hosting. It is necessary to download fonts and upload them to your website manually. Not all fonts are optimized for the web either, but you can test the Webfont Generator.

The Top 10 HTML Fonts

There are a myriad of web fonts to choose from, but where to start? Here are ten simple HTML fonts that will look great on any website. All of them are safe on the internet and should function across all types of devices. They are also great as fallback fonts.

1. Arial

Arial font
A sample of the Arial font.

Arial is the most well-known of the fonts. It's not necessarily the prettiest yet, however it's very simple and effective in a wide range of scenarios.

2. Times New Roman

Times New Roman is also one of the most widely used fonts. It's best if you're running a more formal site. The serif fonts aren't very exciting, but it's non-detracting either.

3. Palatino

palantino
A sample of the Palantino font.

Palatino might be familiar , given that it's a common font used for books printing. Now it's an elegant digital typeface, which is available by default on many devices.

4. Verdana

Verdana is renowned for being extremely easy to read and it continues to look fantastic even in large size. It is a great Arial alternative.

5. Courier New

courier new
A sample that uses the Courier New font.

Reminiscent of old typewriter text, Courier New is a great monospaced design for sites which require a classic but legible look.

6. Calibri

calibri
The Calibri font is an example. font.

Calibri is a basic, lovely sans serif font that comes as a standard feature in programs such as Microsoft Office. But, it's a proprietary font, so it is usually only compatible with Windows operating systems.

7. Georgia

georgia
An example of the Georgia font.

This serif-like font with a rounded design is inspired by the similar web safe font Garamond. If you're looking for the formal look but not as serious as Times New Roman, it's the best choice.

8. Garamond

garamond
A sample of the Garamond font.

Like Palatino, Garamond is a classic font often used for book printing. Despite being updated for modern operating systems, Garamond appears to be a bit old-fashioned.

9. Didot

didot
A sample of the Didot font.

The limited spacing between letters on the serif font creates a unique look and feeling. You can find it on most Apple devices.

10. Tahoma

tahoma
An example of the Tahoma font.

The font's clean design has been used as the default typeface for older versions of Windows OS. Its bolder appearance makes it appear distinct without creating a distraction.

Summary

You don't have to stick with the same boring, safe web fonts which you've come across on the web for decades. Because of fallback fonts you can go with whatever typography you like and set a fallback to be applied if the font doesn't load.

Whether you're employing these HTML fonts on your website as well as in email messages, or your logo, make sure you do lots of tests, to ensure that your website remains accessible, and the typography meshes well to the rest of your design.

Save time, costs and increase site performance:

  • Instant help from WordPress hosting specialists, 24 hours a day.
  • Cloudflare Enterprise integration.
  • Global audience reach with 35 data centers worldwide.
  • Optimization with the built-in Application to monitor performance.