Web Design 35S‎ > ‎

Playing with CSS Fonts

Before you make your web site, make a rough sketch on a piece of paper to show where all the various parts of the assignment will be located. Make sure I see the sketch before you begin.

One of the limitations of HTML is that the only fonts that you can use are the ones someone already has loaded on their computer. That means that since web pages should look basically the same across platforms (on PC, Mac or Linux machines) you're restricted to a very small number of fonts that all computers have.

Google to the rescue. They have created over 800 fonts that you can use to create web pages in over 135 languages. 
  • Their font project makes the fonts open source which means anyone can use them and modify them as they see fit. 
  • While they've got oodles as fonts, as a practical thing I've only been able to get the fonts with one word in their name to work.

This means you can use one of these fonts on your website even if the people visiting your website do not have that font on their devices.

How do you do that?
  • In your stylesheet, insert a phrase something like: body { font-family: 'Pacifico';font-size: 36px;} 
    • Body could also be p  or most other HTML commands.
  • In the head of your document you need to tell your page where to load the font. Insert <link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet'> into the head.
    • Capitalization counts. It seems like all Google Fonts start with capital letters so you need to capitalize the font names.
    • If you want to load multiple fonts separate them with a "post" character which is this one: |. It's found just above the back slash on the right of most keyboards.
  • Instead of Pacifico you can use any of the other font styles available at fonts.google.com.
    • In practice I've only gotten the fonts to work if their names are a single word.
    • I have tried out several fonts and gotten them to work, such as 
      • Tangerine,
      • Oswald,
      • Slabo,
      • Doris,
      • Lobster,
      • Rubik,
      • Poppins,
      • Anton,
      • Lemonada,
      • Hanalei,
      • Pacifico,
      • and Play.
      • Others should work, too, but these are the ones I've tested.
  • So....
    • Create a web page using 3 different Google Fonts.
    • Lay it out as a letter sent to someone important, such as a president or king.
    • Emphasize your major points with one of the Google Fonts.
    • Use appropriately serious colors to match the serious tone of letter.
    • Fill in the content with one of the Lorem Ipsum generators in the left sidebar.

Evaluation

 CSS Fonts
 A 4 paragraph letter to someone important
 
Appropriate colors, styles, etc.
 
 Use of 3 different Google Fonts in a classy, elegant way to emphasize content
 
   


Comments