Start learning with our library of video tutorials taught by experts. Get started

Typography with CSS in Dreamweaver

Setting up @font-face


From:

Typography with CSS in Dreamweaver

with Joseph Lowery

Video: Setting up @font-face

The key to web fonts is the @font-face declaration. This small bit of CSS code allows you to incorporate nonstandard fonts into your web page. With the @font-face declaration, you can change headings like this into headings like this. Let's go through it step by step. So I'm going to go over to main.css, and let's just go straight into Code View and scroll down past the opening comments there, and we'll put-in our @font-face declaration right at the top of all of our other CSS rules.
Expand all | Collapse all
  1. 3m 52s
    1. Welcome
      1m 19s
    2. Using the exercise files
      2m 33s
  2. 19m 16s
    1. Working with the Property inspector's HTML tab
      2m 0s
    2. Making the most of the Property inspector's CSS tab
      4m 57s
    3. Defining and changing type with the CSS Rule Definition dialog
      6m 16s
    4. Modifying type directly in the CSS Styles panel
      6m 3s
  3. 19m 45s
    1. Understanding type measurement unit options
      2m 50s
    2. Working with pixels
      2m 34s
    3. Defining a percentage-based page with ems
      6m 51s
    4. Letting users set page type size
      7m 30s
  4. 17m 36s
    1. Getting to know the basic font categories
      1m 32s
    2. Employing web-safe fonts
      3m 20s
    3. Defining new font families
      3m 22s
    4. Exploring CSS3 typeface options
      3m 9s
    5. Setting up @font-face
      6m 13s
  5. 9m 39s
    1. Dispelling the myth of web-safe colors
      1m 13s
    2. Applying color to type
      4m 52s
    3. Incorporating semi-transparent type
      3m 34s
  6. 19m 46s
    1. Setting the font-weight
      3m 48s
    2. Mandating font case
      2m 25s
    3. Exploring font variants
      1m 50s
    4. Utilizing white space effectively
      3m 40s
    5. Changing letter and word spacing
      2m 20s
    6. Defining first-line variations
      2m 19s
    7. Inserting drop caps
      3m 24s
  7. 20m 17s
    1. Applying CSS3 text effects
      5m 26s
    2. Designing type gradients
      8m 27s
    3. Rotating text with CSS transform
      6m 24s
  8. 15m 21s
    1. Implementing advanced headings with HTML5
      3m 11s
    2. Preparing CSS3 multiple-column layout
      4m 50s
    3. Future type: Defining CSS Regions
      7m 20s
  9. 24m 51s
    1. Styling unordered lists
      6m 51s
    2. Specifying a sequence with ordered lists
      5m 14s
    3. Applying definition lists
      7m 19s
    4. Targeting list items with CSS3 nth child
      5m 27s
  10. 20s
    1. Next steps
      20s

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
Please wait...
Typography with CSS in Dreamweaver
2h 30m Intermediate Jul 29, 2011

Viewers: in countries Watching now:

Dive deep into key typographic concepts and learn how to manipulate type in Dreamweaver. Author Joseph Lowery introduces Dreamweaver type tools and shows how to perform basic text modifications, establish the appropriate type unit, integrate custom web fonts, and apply drop shadows, gradients, and other effects. The course also provides in-depth tutorials on structuring text with headings, paragraphs, columns, and lists, and offers a preview of Adobe's proposed CSS Regions.

Topics include:
  • Modifying type in the CSS Styles panel
  • Understanding the different type measurement unit options
  • Allowing users to set page type size
  • Employing web-safe fonts
  • Exploring CSS 3 typeface options
  • Setting up @font-face
  • Applying color and transparency to type
  • Styling the font weight, case, and letter spacing
  • Inserting drop caps
  • Rotating text with CSS transform
  • Laying out text in multiple columns
  • Incorporating ordered and unordered lists
  • Targeting lists items with the nth-child selector
Subjects:
Typography Web Web Design
Software:
Dreamweaver
Author:
Joseph Lowery

Setting up @font-face

The key to web fonts is the @font-face declaration. This small bit of CSS code allows you to incorporate nonstandard fonts into your web page. With the @font-face declaration, you can change headings like this into headings like this. Let's go through it step by step. So I'm going to go over to main.css, and let's just go straight into Code View and scroll down past the opening comments there, and we'll put-in our @font-face declaration right at the top of all of our other CSS rules.

So we start with @font-face and then open up a curly brace, and I'll just close that out so that we have a complete statement, and now we enter-in a font-family property. Now the name of the font that you enter here is the name you'll use when you're inserting it into the CSS rules as part of other font families. I'll put this in quotes, and the name is DragonwickFGRegular.

We'll close that off with a semicolon. We want to find the source for this font. It is a local file that I have within the directory here. So I'll go ahead and highlight the URL and then press Return or Enter so I can browse for it. It's in Chapter 3, in the 03_05 folder. You'll see an _fonts folder, and then there are four variations of this. We're going to start by choosing the Embedded Open Type variation with the file extension of EOT and click Choose.

Then again, close it out with a semicolon. Not all browsers support all font formats, so you need to use multiple formats and include them in the @font -face declaration correctly. Although Internet Explorer 9 now supports the Web Open Font Format, WOFF file extension, and the TrueType format, earlier versions of Internet Explorer only recognize the Embedded Open Type or EOT format. Moreover, unless you're careful, the earlier versions of Internet Explorer will load all the other formats.

So to avoid that issue, you have to use a little code trickery. So let's continue with our @font-face declaration, and we'll put-in another source. This time instead of putting in a URL, we're going to say that it's local, which means that it's going to be on the user's system. What we're trying to do is to avoid actually picking any of the files on the user's system. So we'll put-in an opening parenthesis and a pair of quotes and this time instead of a font file name, we'll actually put-in an exclamation mark which is extremely likely not to be the name of any font that is on a user system.

We'll follow that by closing off the parenthesis and then putting-in a comma. I'm going to put this on the second line here, just give it a little bit of space to show that it's all part of the same source. So this is where we're going to bring in the other two formats. So we'll do a URL, and this time, I'm going to go ahead and just copy this path, paste that in, and change the file extension from EOT to WOFF; that's the Web Open Font Format.

Then after I close the parenthesis, I'll put-in another attribute which is format, and in quotes WOFF. Close the parenthesis and add a comma, so we can add in the next format. Again, a URL version, and let's copy that, and then paste it in here. Our final format is a TrueType and they use a file extension of TTF.

We will again put in the format attribute with TrueType. Now, if you're typing along with me, and you notice that whenever I type a single quote, a double quote appears, that's because I'm using Dreamweaver 5.5. If you're not seeing that, you're probably on Dreamweaver 5. This whole technique that we're seeing here was developed by a gentleman named Paul Irish who called this method the Bulletproof Technique, which seems to be actually quite true, and it's in wide use throughout the web.

Now that you made it possible to use a linked font, you must apply the font family to the desired selector. So let's go to Design View and open up the CSS Styles panel. I'll go ahead and select the h1 tag which is what we're going to look to replace, and I'll see which rule is already controlling the font, and that's the #mainContent h1. So let's go to that code by right- clicking on that, and choosing Go to Code. I'm just going to add in my new font name right in front of the existing font family, DragonwickFGRegular. Okay.

Let's save our page, go back to Design View, and you should see it immediately appear. If you don't see the font-face right away, just click Refresh. Changing a single font is a pretty simple example, but you can see the power of web fonts immediately. Not only is this text selectable and thus can be copied and pasted, but it's also eminently more search engine-friendly. Of all the improvements brought by HTML5 and CSS3, I really think that web fonts place among the most impactful, as they open the door for a far truer expression of the designer's artistry.

There are currently no FAQs about Typography with CSS in Dreamweaver.

Share a link to this course
Please wait... Please wait...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Typography with CSS in Dreamweaver.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

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.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked

Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.