Created
May 23, 2012 17:18
-
-
Save ten1seven/2776468 to your computer and use it in GitHub Desktop.
How to use font weight with web fonts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'MyFont'; | |
src: url('path-to-normal-font'); | |
... | |
font-weight: 400; | |
font-style: normal; | |
} | |
@font-face { | |
font-family: 'MyFont'; | |
src: url('path-to-bold-font'); | |
... | |
font-weight: 700; | |
font-style: normal; | |
} | |
body { | |
font-family: MyFont, fallbackfont; | |
} | |
.normal-text { | |
font-weight: 400; | |
} | |
.bold-text { | |
font-weight: 700; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This allows you to specify a font fallback and still use the correct bold or normal version either way.