Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
This course focuses on the theories behind web fonts: what makes a good font, why different fonts look the way they do, and how fonts affect the look of a web page. Author Laura Franz covers common tasks, including downloading a font from an online source such as Typekit or Font Squirrel, implementing the font in HTML and CSS, and changing the size and line-height to improve the readability of text. The course also covers different periods of type design and explores the history behind handwritten fonts, text fonts (used for large amounts of text), and display fonts (used for headlines).
There are many ways to work with more than one font in a website. One way is to use the fonts for separate purposes. For example, earlier in the course, when we looked at Modern fonts, we couldn't find any that worked in text. That's because Modern fonts have such thin thins they get lost on the screen at text sizes. But if we were to use one font for headings and the other font for text, we might be able to use a Modern font for a heading. I followed the process from the last lesson and compared Unna, our Modern font, to all of the other fonts we've used in this course.
There are lots of other fonts out there but I wanted to keep it limited to the ones we've already looked at. Due to Unna's structure which isn't Humanist, I think Nimbus Sans might work for us. I'm a little concerned it might feel too dark on the page with Unna, Nimbus Sans has a slightly heavy weight, so I've got Arial as a backup. I actually think from experience that Arial will work better but I want to try Nimbus Sans first because I'm tired of using default fonts and I want to use something new. For the rest of this lesson, I'm going to show you how I made decisions about pairing Unna with a Transitional Sans Serif font.
If you'd like, you can sit back and watch. If you want to follow along in the CSS, you can. I saved a copy of our Nimbus Sans page in the Exercise Files for this chapter. I've named it nimbus_sans_tk_unna_site.html. Let's open it up in our Text Editor. I've already added Unna to the file. I want to point out two things. One, we're using both the Google font and a Typekit font in the same file. I rarely do this.
I find that when I do, the fonts load a little more slowly. But if you do do it, I recommend putting the Google font syntax before the Typekit syntax. The other thing I want to point out is that Nimbus Sans won't work on your page. That's because the embed code is from my kit and only works on my server. So you need to go to Typekit, make sure Nimbus Sans is in your kit, publish it and copy and paste your embed code into your HTML document. Upload your file to the server. When you're done, meet me back here.
Okay, now that your Nimbus Sans is set let's look at what we have. We can see that Nimbus Sans is in the universal selector. That makes sense because this file was created from our old Nimbus Sans file. I've already added Unna and we have it for the H1 set at 37 on 39 pixels. We have it in the H3 set on 30 on 30 pixels. In the H4 it's set at 23 on 23 pixels and I've set the font weight to normal because Unna doesn't have a bold.
I've also added it to the quote set at 22 on 27 pixels and I've removed the font style italic because Unna does not have an italic. Now let's take a look at this in the Browser. You can see the two fonts I used on the page. The headings and quote are in Unna and the rest of the text is in Nimbus Sans. I'd like to try and pull the heading font into the page a bit so it doesn't feel too separate from the text. Using Unna in the quote helped me do this. But there is a bit of a problem with hierarchy.
Unna doesn't have a bold or italic, so I'm basically only using size to separate the main heading from Around Town and in Save the Date to the event and article headings. And there isn't quite enough hierarchy, the headings feel too similar. If we look at Save the Date and the Library Used Book Sale, they sort of blend in, there's not quite enough difference between the two of them. So I saved another version of the document and I tried to make more hierarchy simply by capitalizing our Around Town and Save the Date headings.
I've also added one pixel of letter spacing. Modern fonts have a beautiful contrast between thick and thin and an elegant structure and it really comes out when it's set in all caps with a little bit of spacing. But the problem now is that Around Town and Save the Date stand out too much. They're sort of big and clunky and they begin to compete with the main heading. So I saved another version of the document and made these a little bit smaller. I changed the size to 25 pixels. Now they don't compete with the main heading which is good but they've lost some of their power in the right-hand column here.
Again, these two headings are starting to feel too similar. I think the problem is our H4, which is the event and article headings. They don't have quite enough hierarchy. As I scan down this right column looking for an event, they don't pop out at me. So I saved the document again and changed our H4s to 17 pixel bold Nimbus Sans. This helps chunk the events and make the titles pop out. I'll scroll down again. But now my main problem is that the Nimbus bold is too heavy.
If we look here again at Library Used Book Sale, the e is starting to almost fill in, it feels very heavy under the SAVE THE DATE. So I decided to just give up and try to make the Nimbus Sans work with the Unna, and I made another version using Arial. It's a good font. It has the lighter strokes so the e is no longer filling in here under Used, and then also the text weight is a little bit lighter as well. And there is a good contrast between the bold and the regular text, and I think that contrast works really nicely with the thick and thin strokes of the Unna.
So using the Arial feels a little bit more appropriate to me with the Unna. Nimbus Sans, we'll pop back to that. It's a lovely font but it just doesn't work in this context. The Arial feels lighter and it feels a little bit more cohesive. I've provided both the final Nimbus Sans file and the Arial file in the final Exercise Files, if you want to see the final type settings. Working with two fonts means spending time and figuring out the hierarchy. It also means being willing to make changes as you work through the process.
There are currently no FAQs about Choosing and Using Web Fonts.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.