{"id":22064,"date":"2013-06-17T19:24:14","date_gmt":"2013-06-18T02:24:14","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=22064"},"modified":"2015-05-15T09:22:18","modified_gmt":"2015-05-15T16:22:18","slug":"font-family","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/f\/font-family\/","title":{"rendered":"font-family"},"content":{"rendered":"
The A value can be one of the following:<\/p>\n If multiple family names are used, the browser will select the first one it finds either embedded on the page using For If multiple values are used for a single declaration, it is recommended to have a generic family<\/a> listed last as a fallback to ensure the best typographic experience:<\/p>\n In the above example, “Courier” and “Monaco” are real family names of actual fonts, whereas “monospace” is just a generic reference to any font installed on the user’s system that’s monospaced.<\/p>\n If the first two are not found installed, the browser will select the best option, but only from monospace fonts. Without the generic family, the font would default to whatever is the default font on the user’s system (likely a serif or sans-serif), which would be undesirable.<\/p>\n Generic family names include If a family name matches a generic family name, the family name should be quoted to indicate that it is not generic.<\/p>\n If a family name contains multiple words, separated by spaces, it is recommended to list the family name in quotation marks (single or double):<\/p>\n This isn’t always necessary, but it is generally safer to include the quotes for any family name that has spaces or special characters.<\/p>\n The font-family property defines the font that is applied to the selected element. The font that is selected is not a single font face, but a “family”, and thus may be dependent on other typographic property values to select the correct face within the family. body { font-family: Arial, Helvetica, sans-serif; } A value can […]<\/p>\n","protected":false},"author":7178,"featured_media":0,"parent":13921,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"page-almanac-single.php","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":""},"tags":[],"acf":[],"jetpack-related-posts":[{"id":253584,"url":"https:\/\/css-tricks.com\/almanac\/properties\/f\/font-display\/","url_meta":{"origin":22064,"position":0},"title":"font-display","date":"April 17, 2017","format":false,"excerpt":"The font-display property defines how font files are loaded and displayed by the browser. It is applied to the @font-face rule which defines custom fonts in a stylesheet. @font-face { font-family: 'MyWebFont'; \/* Define the custom font name *\/ src: url('myfont.woff2') format('woff2'), url('myfont.woff') format('woff'); \/* Define where the font can\u2026","rel":"","context":"In \"font-display\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":22040,"url":"https:\/\/css-tricks.com\/almanac\/properties\/f\/font-style\/","url_meta":{"origin":22064,"position":1},"title":"font-style","date":"June 17, 2013","format":false,"excerpt":"The font-style property allows you to make text appear italicized (i.e. sloped, or slanted). em { font-style: italic; } This property accepts one of three possible values: normal, italic, and oblique. If a given font family has an italic or oblique face embedded, the browser will select that face. If\u2026","rel":"","context":"With 9 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":22055,"url":"https:\/\/css-tricks.com\/almanac\/properties\/f\/font-weight\/","url_meta":{"origin":22064,"position":2},"title":"font-weight","date":"June 17, 2013","format":false,"excerpt":"The font-weight property sets the weight, or thickness, of a font and is dependent either on available font faces within a font family or weights defined by the browser. span { font-weight: bold; } The font-weight property accepts either a keyword value or predefined numeric value. The available keywords are:\u2026","rel":"","context":"With 14 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14053,"url":"https:\/\/css-tricks.com\/almanac\/properties\/f\/font\/","url_meta":{"origin":22064,"position":3},"title":"font","date":"September 5, 2011","format":false,"excerpt":"The font property in CSS is a shorthand property that combines all the following sub-properties in a single declaration. body { font: normal small-caps normal 16px\/1.4 Georgia; } \/* is the same as: body { font-family: Georgia; line-height: 1.4; font-weight: normal; font-stretch: normal; font-variant: small-caps; font-size: 16px; } *\/ There\u2026","rel":"","context":"With 5 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":249514,"url":"https:\/\/css-tricks.com\/snippets\/css\/system-font-stack\/","url_meta":{"origin":22064,"position":4},"title":"System Font Stack","date":"January 3, 2017","format":false,"excerpt":"Defaulting to the system font of a particular operating system can boost performance because the browser doesn't have to download any font files, it's using one it already had. That's true of any \"web safe\" font, though. The beauty of \"system\" fonts is that it matches what the current OS\u2026","rel":"","context":"In \"font-face\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":235583,"url":"https:\/\/css-tricks.com\/almanac\/properties\/f\/font-feature-settings\/","url_meta":{"origin":22064,"position":5},"title":"font-feature-settings","date":"December 4, 2015","format":false,"excerpt":"This property gives us control over advanced typographic settings such as small caps, ligatures, and swashes. To activate them you must declare which value you need in quotes and then followed by either 1 or on to enable. Alternatively, you can disable them with either 0 or off: .element {\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/22064"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/7178"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=22064"}],"version-history":[{"count":3,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/22064\/revisions"}],"predecessor-version":[{"id":202373,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/22064\/revisions\/202373"}],"up":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/13921"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=22064"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=22064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}font-family<\/code> property defines the font that is applied to the selected element. The font that is selected is not a single font face, but a “family”, and thus may be dependent on other typographic property values to select the correct face within the family.<\/p>\n
body {\r\n font-family: Arial, Helvetica, sans-serif;\r\n}<\/code><\/pre>\n
\n
@font-face<\/code> or installed on the user’s operating system.<\/p>\n
font-family<\/code> there is no specific default or initial value; the initial value always depends on the browser and\/or operating system.<\/p>\n
Generic Family Names<\/h3>\n
code {\r\n font-family: Courier, Monaco, monospace;\r\n}<\/code><\/pre>\n
serif<\/code>,
sans-serif<\/code>,
cursive<\/code>,
fantasy<\/code>, and
monospace<\/code>.<\/p>\n
Multi-word Family Names<\/h3>\n
code {\r\n font-family: \"Times New Roman\", Georgia, serif;\r\n}<\/code><\/pre>\n
Related Properties<\/h3>\n
\n
Other Resources<\/h3>\n
\n
Browser Support<\/h3>\n
\n\n
\n Chrome<\/span><\/th>\n Safari<\/span><\/th>\n Firefox<\/span><\/th>\n Opera<\/span><\/th>\n IE<\/span><\/th>\n Android<\/span><\/th>\n iOS<\/span><\/th>\n<\/tr>\n<\/thead>\n\n \n Works<\/td>\n Works<\/td>\n Works<\/td>\n Works<\/td>\n Works<\/td>\n Works<\/td>\n Works<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"