- Tags: Text
- Categories: CSS Reference, CSS Resources, Reference
Quick Reference
The @font-face rule allows for the use of fonts other than “web-safe” fonts. A font name is defined for the font and then the custom font is pointed to it.
This is NOT specific to any elements. It is just used to load the font for use in the font-family property to apply to an element.
@font-face {
font-family: "Open Sans";
src: url("/fonts/opensans-regular-webfont.woff2") format("woff2"),
url("/fonts/opensans-regular-webfont.woff") format("woff");
}
Values
These are the allowed values.
Font Descriptor | Values | Description |
---|---|---|
font-family | name | Defines the name of the font (required) |
src | URL | Defines the URL(s) where the font should be downloaded from (required) |
font-stretch | normal condensed ultra-condensed extra-condensed semi-condensed expanded semi-expanded extra-expanded ultra-expanded | Defines how the font should be stretched (default value is “normal”) |
font-style | normal italic oblique | Defines how the font should be styled (default value is “normal”) |
font-weight | normal bold 100 200 300 400 500 600 700 800 900 | Defines the boldness of the font (default value is “normal”) |
unicode-range | unicode-range | Defines the range of unicode characters the font supports (default value is “U+0-10FFFF”) |
We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.
Why 1SMARTchicken?
See More →
Thanks for your support!
CSS Books
All are affiliate links. Thank you for your support!
CSS NOTES:
- The “inherit”, “initial” and “unset” keywords can be used with any CSS property to set its value
- In CSS there are many ways to express a color value in a property
Feedback
If you see an error on the page or the code itself is incorrect or incomplete, or just plain wrong, please let us know. We’re always learning. NOTE: we do not sell your information and will not send you spam emails.