Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Learn how to choose fonts for a web site and create beautiful, legible type. Author Laura Franz shares how to create designs that maximize readability (and keep visitors on the page) by paying attention to details in size, line-height, line length, alignment, color, vertical space, and more. Laura also demonstrates how to incorporate web fonts, style type with CSS, and pick fonts that work well together.
In this lesson, we'll be putting some space between the content and the edge of the page. You'll need the files biblio_sans_ page.html and biblio_sans_page.css from the Exercise folder. Open up the HTML file in the browser to see what we're working with. The page is set up and we've got our background image, but there is not enough space between the content and the edge of the page. This is a modernist page so we don't have to create a text frame, but it's still too tight for comfort.
Right now with the tight edges, the text looks like it's going to fall off the page and the yellow rule-line looks like it's cutting the page in half. Let's change that by adding in space around the content of the page, but first, we need to figure out how much space we want to add. We could go as high as 99em wide for the page, but that's too wide. We could use a width of 96em. That's a very popular width. There is even a grid system based on 960 pixels, which is 96em in our case, but it's still too wide for what our text needs.
The text feels lost and wimpy in so much space. Let's try making the page narrower. 76em looks good. I wouldn't go any narrower. The links across the top need the room. Now let's look at the margins. Currently, we have equal left and right margins, although they don't feel that way because the left column has right aligned text and a lot of open space. It looks pretty good, but we can still try other placements to see if it could be better. We can try shifting everything to the right to increase tension.
This feels too far over. The left side feels empty. Let's try moving it over to the left a little bit. This isn't bad. The vertical line is strong here and the page feels balanced. The left doesn't feel so empty. What if we shift it further to the left? This feels too centered, even though it's got a tighter left margin, probably because the right column, the one with all the content, is more central on the page. It's fine, but it lacks tension. This field is less centered and it might be the one.
The entire content is slightly left of center while the main text is slightly right of center. The margins are good, nothing is too equal. Nothing is too tight. Looking at this one makes me realize that the original centered version feels too far to the right. Again, it's not bad. it just felt too far to the right on the page. We've got the page looking the way we want it. So let's set the spacing in the CSS. In the CSS, look for the div ID main_container.
We're going to keep the width we've been using 60em and we're going to add padding on the left and right to add space. First, we'll do some padding-top. I'll actually just set that to 0 and then padding-right is 10em and padding-bottom is 4.8em. I got that measurement because it's 1 1/2 times the height of the navigation links at the top of the page. And padding-left is 6em.
Let's save this and review it in our browser, and refresh. And great! We've added space to the left and right of our content. It looks good, except the navbar isn't the same width as the white part of the page. Why not? Well, the navbar is in a nav container that is the same width as the main container. We just can't see it yet. It doesn't have a background color. Let me show you. Here is our nav_container. Let's add a background color to it.
We'll make it sort of gray color here six 9s, #999999. Let's save this and we can view it in our browser. We're going to keep the navbar narrower than the div that it's in. Why? Because text changes slightly between browsers. If we make the nav links fit perfectly in a div, they may work in one browser, but they can be narrower or wider in another browser, because text renders differently across browsers.
And if the links get too wide, the row of links would break inside the div. Here, I've created a version of this file with a slightly narrower nav container. You can see here that the div the nav container is in is narrower than the other one we were looking at, just a little bit of gray there in the background. It still works fine here in Firefox, but if I view it in Safari, the links break, because even though it's the exact same text that are at the exact same size and font, in Safari the text comes in slightly bigger and slightly looser, so all the text doesn't fit in the div and our navbar breaks.
So that's why we're going to keep the div that the navbar lives in a little bit wider than the actual navbar. Of course, we're now going to keep it with a gray background. Let's go in and change that. Our nav container should actually have the same color as the backgrounds of our links. So let's change that. It is #264c73, we can save it, and let's review that in our browser. Excellent! Now, you don't even know that it's in a different sized div.
There is a slight change here. We'll see a little bit of the blue on the outside when we hover over a link, but at least we know that they won't break and they won't break in Safari either. We're going to double-check that though. I can copy this URL up here in Firefox and then in Safari I can paste it, and it looks great in Safari, and it looks great in Firefox. All we have to do? Well, I'd just like to scroll down to the bottom and make sure that bottom margin is working, and it's pretty good. I like it. All right! So we're set and we're finished with a modernist bibliography.
We'll come back later in the course to finish up details like punctuation, but for the most part, it's done. We've really paid attention to the modernist elements in the layout. The architectural space, the hierarchy, the clean sans serif font, and the companion serif font. It's not too traditional looking. We've also tried to create rhythm intention by creating a focal point and a strong vertical line, and by not keeping everything too equal on the page. Great job!
Find answers to the most frequently asked questions about Typography for Web Designers.
Here are the FAQs that matched your search "":
Sorry, there are no matches for your search ""—to search again, type in another word or phrase and click search.
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.