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).
Now that our site is using Crimson Text it looks pretty good, but the text is a bit small; a bit hard to read. That's because Crimson Text has a smaller x-height than Georgia. Also, we chose a semi-italic bold to use for the sentence about Bay Road businesses remaining open, but it's still set as plain bold in the HTML. Let's change these things. Using the HTML file from the last lesson, we'll start by increasing the type size. In our CSS, let's change the universal selector to 16 pixels, and a 23 pixel line height.
Save this, and reload it in the browser. That looks pretty good, but it's still too small, and the lines of text feel a little bit too far apart. So back in the CSS, let's change our font size to 17 pixels, and keep the line height at 23. We'll save this, and refresh in the browser. I'm using Command+R to refresh. That looks better. Now, you may have noticed in an earlier video when we were choosing an old style font that Crimson was at 19 pixels, and it was a comfortable reading size.
Here we're using it at 17 pixels, and it's also a comfortable reading size. So how can the same font feel right at two different sizes? Well short, easy to read blurbs of texts with shorter line links, like the text on this site, can be set a little smaller and still be easy to read. You'll find that more theoretical or instructional text with a longer line length needs to be set a little bit larger. So we've got our text type size set, but now everything else looks a little bit weak. The article and event headings are a little too small, and so is the quote in the right-hand column.
Let's go in and bump everything up by two pixels and see what happens. So back in our editor, we'll make our h1 32 and 34. We'll make our welcome to 16. The h2, we'll change to 19 and 19. The h3, we'll change to 26 and 26. The h4, we'll change to 18 and 18. The quote, we'll change to 17 and 24.
And the acronym -- that's the AMs and PM's within the text -- we will change to 15. Go ahead and save this, and refresh it in the browser, and that looks a lot better. I'm still not crazy about the article and event headings, though. They're a little too far from the text that they belong to. You can see the space there, and then there. And in fact, the heading Library Used Book Sale looks like it belongs more with Save the Date than it does with the date and time information underneath it. So in the CSS, let's find our h4, and change that margin to 2 pixels.
I think we're also going to change it to a 19 and 19 size and line height, so it can be a little bit bigger, and then try refreshing it. Well, the headings definitely feel more like headings, but I think they're still a little bit too far away from their texts. So let's go back into the CSS, and let's change that margin even smaller, bottom margin to 1 pixel, I'll save this, and refresh it, and that's looking better, but I wish that the Library Used Book Sale was a little bit further from Save the Date.
So let's go and change that. The h3, right now it's got an 8 pixel margin bottom, and we're going to change that to 12 pixels. I saved, and now refreshing it, and that looks better. The Library Used Book Sale now looks like it belongs a little bit more with the date and time information after it instead of with the heading above it. I'm still not crazy about the h4, but let's move on to some other areas of the page, and as I fix other things, we might be able to figure out how to fix the article and event titles.
So first of all, let's try getting rid of the bold for the sentence about the Bay Road businesses. I'm using the strong to set that sentence, and right now it's using just bold, and I want to use a semi-bold italic here. I think we would use a font weight of 600, and a font style of italic, but I do want to go back into Google Web Fonts and make sure that that is how they set it. Yes, semi-bold italic is 600. Excellent.
I can see here, we've done it a 600 italic, save this, and let's refresh that in our browser. Excellent; it worked. There we go. Bay Road businesses are open during construction. Now, one other thing I'm starting to notice about Crimson Text is how narrow its italics are. The italics feel a little smaller than the Roman text, and they're also a little harder to read. It might not be a problem for this single sentence here about the Bay Road businesses, since most people only need to read the first four words anyway, but over here, the quote feels quite small, and it's tight, and I usually like to think of quotes as being meaningful and inspirational, so I'd like it to be a bit bigger and to have more presence.
So let's go in and bump that up a bit. Let's change this so it's on 18 pixels, and we will keep the line height; that should work. Saved it. Okay, that's a little bit better. I'd still like to do something about those articles and event headings though. The bold just feels too heavy for my taste. It occurs to me that the old style fonts didn't have bold weights, and I'm looking at this old, elegant font, and I'm wondering if maybe I should create a heading more in line with how headings would have used to have looked back when old style fonts were originally used.
So an old style font would often have been set in all caps with a little extra letter spacing, and that would help them look refined and elegant. So let's try that. So with the h4, let's get rid of the bold, and do a text transform to uppercase, and add some letter spacing. Just one pixel, save that, and let's see how it looks. Well, it definitely feels more elegant, but there are some problems doing it this way.
For instance, over here with the Library Used Book Sale, it's now on two lines, as is the Raynor Pond Clean Up. So this isn't going to work for us. One thing we could try is maybe getting rid of the letter spacing and see if that works. Let's go back into the editor and refresh, and that didn't really help. It looks a little bit darker, which would be good, but it didn't solve the problem with the Library Used Book Sale, or with the Raynor Pond Clean Up, so I don't think using all caps is going to work for us.
So the next thing I'm wondering is maybe instead of using all caps, we can go back, choose regular case, but try using the semi-bold instead of the bold, and that might be more in line with the sort of old style, traditional, elegant look. So back in the text editor, I'm going to go ahead and get rid of the uppercase, and I want to use a font weight 600, so that will be the semi-bold, but then, I also need to go back into my browser to Google Web Fonts, because we didn't choose semi-bold to begin with.
So let's select semi-bold, and turn off the bold, because this is such a memory intensive font, and really for any Web fonts, only choose the weights and styles you know you're going to use. Then we will have to go down and reselect, and recopy this code, because it will have changed since we've changed what weights and styles we're going to use. Back in the text editor up at the top let's replace that code, and save it, and refresh, and that's working better.
It's not quite as heavy using the semi-bold instead of the bold for the event and article headings, but now I'm no longer thrilled about the amount of space underneath the headings. When we used the bold that, they felt too far away from the text, and using the semi-bold, they look a little too close to the text. There must be a built-in vertical spacing that's a little bit different from one weight to the other. So we're going to have to go back in and fix that. Down in the h4, let's set our margin bottom back to 2 pixels, and let's save this, and refresh it, and that's better.
There's a little bit more space there. I think that we've got it. Well actually, no. I'm also noticing now that there's that extra space after Save the Date, which I had also added when we were using the bold. We should take some of that out. It was at 12 pixels; we changed that to 12 pixels. Let's bring that back down to, say, 10, or even 9 pixels. There we go. That's better. Now it's not quite so far away. I do think we've got it. It looks pretty good. So make sure you keep this file for the next lesson.
We had to do a lot more noodling with the Crimson Text version of this page. Every font is different, not just in terms of how the letters look, but also in terms of how heavy their bold weight is, how narrow their italic, and even how spacious the font feels, both horizontally and vertically.
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.