So how can we use this rule? @font-face rule | SoloLearn: Learn to code for FREE!


So how can we use this rule? @font-face rule

9/6/2016 4:40:25 PM

Akida M Jafar

2 Answers

New Answer


@font-face { font-family: Example; src: url('Example-Roman.otf'); } @font-face { font-family: Example; font-weight: bold; src: url('Example-Bold.otf'); } h1{ font-family: Example, sans-serif; }


This is what i used on my website, its a *.ttf font on the web: @font-face { font-family : Ubuntu; font-style : normal; font-weight : 300; src : local('Ubuntu Light'), local('Ubuntu-Light'), url( format('truetype'); } body{ font-family: Ubuntu,Helvetica,Arial,sans-serif; } If the Ubuntu-font can't be used it goes to "Helvetica" ,"Arial" and if none is found it uses (buildin OS) "sans-serif"