Using Google Fonts

google-fontsWhen formatting text on a webpage, you will more likely want to use different types of fonts. You may be tempted to use fonts that are installed on your own computers. However, you need to be careful as there is no guarantee that these fonts are also installed on the computers of the client computers/tablets/smartphones of users who will access your webpage.

To remedy this problem, you can limit your choice of fonts to “web-safe” fonts. These are a set of fonts which are installed on nearly every computer/tablet/smartphone. Check this page to access a list of web-safe fonts: http://www.w3schools.com/cssref/css_websafe_fonts.asp.

The list of web-safe fonts being very limited, you may then investigate using Google Fonts. These are fonts that are hosted on Google servers and that you can link from your webpages. Which means every time a user loads your page, their browser will also load the required fonts from Google servers. Though this may slow down the loading of your page, it will give you access to hundreds of fonts to choose from and is a very reliable approach to spice up the look and feel of your website.

Check the list of available Google Fonts: https://fonts.google.com/.

The following video clip explains how to use Google fonts on your own webpages.

Video Tutorial


Additonal Video:
Google Fonts in less than 3 minutes: https://youtu.be/peR9V-f9OkI

HTML & CSS Code


You will need to add the following code in the <HEAD> section of your code:

And then in HTML your code either use the

Or in CSS:

Share Button
Posted in Computer Science, HTML / CSS Tagged with: ,

Our Latest Book