bethrobson / Head-First-HTML

Code for the 2nd edition of Head First HTML and CSS
558 stars 597 forks source link

chapter8: @font-face rule issue #4

Closed nikkohijo closed 4 years ago

nikkohijo commented 6 years ago

In chapter 8, page 325, the code doesn't seem to work.

@font-face {
  font-family: "Emblema One";
  src: url("http://wickedlysmart.com/hfhtmlcss/chapter8/journal/EmblemaOne-Regular.woff"),
       url("http://wickedlysmart.com/hfhtmlcss/chapter8/journal/EmblemaOne-Regular.ttf");
}

but altering it to this, does.

@font-face {
    font-family: "Emblema One";
    src: url("EmblemaOne-Regular.woff") format("woff");
}
Vjacheslav74 commented 5 years ago

The same

ckloudy commented 4 years ago

Neither of these options are working for me. Do I have to save the file on my system for this to work?

Edit: Found a work around using @import as it isn't very clear what you are supposed to do here, IMO.

bethrobson commented 4 years ago

Hey there, yes please save the font files on your local machines and change the URLs to a relative path to the fonts! See code in chapter8. https://github.com/bethrobson/Head-First-HTML/blob/master/chapter8/journal/journal.css