{"id":830,"date":"2022-09-12T18:32:29","date_gmt":"2022-09-12T18:32:29","guid":{"rendered":"https:\/\/glossary.dream.press\/glossary\/%group%\/font-family\/"},"modified":"2026-08-07T11:34:08","modified_gmt":"2026-08-07T11:34:08","slug":"font-family","status":"publish","type":"glossary","link":"https:\/\/glossary.dream.press\/glossary\/web-design\/font-family\/","title":{"rendered":"font-family"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The browser works through a font-family list from top to bottom and applies the first font that is installed or that it can download with an @font-face rule; every name after the first is a fallback. In <a href=\"https:\/\/www.dreamhost.com\/glossary\/web-design\/css\/\">CSS<\/a>, the fonts appear in priority order, separated by commas, and each is written as a <em>family-name<\/em> or a <em>generic-name<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s a realistic declaration: <code>font-family: Helvetica, Arial, sans-serif;<\/code>. The browser tries Helvetica first, moves to Arial if Helvetica isn&#8217;t installed, and finally falls back to whatever sans-serif font the visitor&#8217;s device has.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How the browser chooses a font<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The browser picks the first font in the list that is installed or that a @font-face rule can download. Selection doesn&#8217;t stop there: per <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/Reference\/Properties\/font-family\">MDN&#8217;s CSS reference<\/a>, fonts are selected one character at a time, so if the chosen font is missing a glyph, say, a currency symbol or an accented letter, the browser pulls that character from the next font in the list.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1536\" height=\"1024\" data-src=\"https:\/\/www.dreamhost.com\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba.webp\" alt=\"Flowchart showing how a browser resolves the stack font-family: Helvetica, Arial, sans-serif. At each font the browser checks whether it is available: if yes, that font is used; if no, it moves to the next name, ending at the generic sans-serif keyword, which always applies as the safety net.\" class=\"wp-image-11769 lazyload\" data-srcset=\"https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba.webp 1536w, https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba-300x200.webp 300w, https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba-1024x683.webp 1024w, https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba-768x512.webp 768w, https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba-600x400.webp 600w, https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba-1200x800.webp 1200w\" data-sizes=\"(max-width: 1536px) 100vw, 1536px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1536px; --smush-placeholder-aspect-ratio: 1536\/1024;\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If none of the named fonts is available and the list has no generic family, the browser substitutes its own default font, and your design intent is lost. No font is guaranteed to exist on a visitor&#8217;s device, so end every font-family list with a generic keyword.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Family names and generic names<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <em>family-name<\/em> value names a specific font family, such as Helvetica. Write family names as quoted strings or as unquoted identifiers. A multi-word name like Gill Sans may stay unquoted when each word is a valid CSS identifier, but quoting is the safer habit: quote any name containing white space, digits, or punctuation characters other than hyphens, for example <code>\"Gill Sans Extrabold\"<\/code> or <code>\"Goudy Bookletter 1911\"<\/code>, to avoid escaping mistakes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <em>generic-name<\/em> value is a fallback: the browser uses it when none of the named fonts is available. It must be an unquoted keyword. Writing <code>\"serif\"<\/code> in quotes makes the browser treat it as a specific font&#8217;s name, so the fallback silently stops working. Put the generic name last in the list.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The generic font families<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Each generic name describes a broad style category rather than one font. CSS defines 5 classic generic families, plus <code>system-ui<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><strong>serif<\/strong>: glyphs have finishing strokes with flared or tapering ends, like Georgia.<\/li>\n\n\n<li><strong>sans-serif<\/strong>: glyphs have plain stroke endings, like Arial or Helvetica.<\/li>\n\n\n<li><strong>monospace<\/strong>: every glyph has the same fixed width, the standard pick for code.<\/li>\n\n\n<li><strong>cursive<\/strong>: glyphs generally have joining strokes, like handwriting.<\/li>\n\n\n<li><strong>fantasy<\/strong>: primarily decorative display fonts.<\/li>\n\n\n<li><strong>system-ui<\/strong>: whatever font the visitor&#8217;s operating system uses for its own interface.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Newer keywords exist as well: <code>ui-serif<\/code>, <code>ui-sans-serif<\/code>, <code>ui-monospace<\/code>, <code>ui-rounded<\/code>, <code>math<\/code>, and <code>fangsong<\/code>. Support depends on the keyword, per <a href=\"https:\/\/caniuse.com\/extended-system-fonts\">caniuse.com support tables<\/a> (StatCounter usage data, July 2026). <code>system-ui<\/code> works in every major browser, supported since Chrome 56, Edge 79, Safari 11, and Firefox 92. <code>math<\/code> joined more recently: Chrome and Edge 109, Firefox 149, and Safari 26.2. The 4 ui-* keywords render only in Safari 13.1 and later, and fangsong has no caniuse table at all, so treat those as experimental and always end the list with a classic generic family.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a closer look at the two most common categories, see our <a href=\"https:\/\/www.dreamhost.com\/glossary\/web-design\/serif-sans-serif-font\/\">serif and sans serif fonts<\/a> entry.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Font vs. font family<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A font family is the whole named design; a font is one member of it in a specific weight and style. In CSS, the two are selected by different properties:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>A font family is the complete design, such as Helvetica.<\/li>\n\n\n<li>A <a href=\"https:\/\/www.dreamhost.com\/glossary\/web-design\/font\/\">font<\/a> is one member of that family, such as Helvetica Bold Italic.<\/li>\n\n\n<li>font-family selects the family, while <a href=\"https:\/\/www.dreamhost.com\/glossary\/web-design\/font-weight\/\">font-weight<\/a> and <a href=\"https:\/\/www.dreamhost.com\/glossary\/web-design\/font-style\/\">font-style<\/a> pick the member&#8217;s weight and style.<\/li>\n\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Web-safe font stacks<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A web-safe stack lists fonts that ship pre-installed across operating systems, so text looks close to identical everywhere without downloading anything. Two dependable examples: <code>font-family: Arial, Helvetica, sans-serif;<\/code> and <code>font-family: Georgia, serif;<\/code>. For a full list organized by category, see our <a href=\"https:\/\/www.dreamhost.com\/blog\/web-safe-fonts\/\">guide to web-safe fonts<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Custom fonts and Google Fonts<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">font-family can only select fonts the visitor&#8217;s browser already has or can download, so a custom font has to be loaded before you can name it. Load it with a @font-face rule or a hosted service like Google Fonts, then reference the registered name in your font-family list, still ending with a generic fallback in case the download fails. Our picks of the <a href=\"https:\/\/www.dreamhost.com\/blog\/best-google-fonts\/\">best Google Fonts<\/a> cover choosing and pairing, and our guide to <a href=\"https:\/\/www.dreamhost.com\/blog\/optimize-web-fonts\/\">web font performance<\/a> covers the load-time cost that downloaded fonts add.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">font-family is one of several CSS font properties. Pair it with <a href=\"https:\/\/www.dreamhost.com\/glossary\/web-design\/font-size\/\">font-size<\/a> to control how large the chosen typeface renders, and test your stack in more than one browser before you ship it.<\/p>\n","protected":false},"featured_media":0,"parent":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"_yoast_wpseo_focuskw":"","_yoast_wpseo_title":"What is font-family in CSS? %%sep%% %%sitename%%","_yoast_wpseo_metadesc":"What is font-family in CSS? Learn how this property sets a prioritized font stack, why a generic fallback goes last, and when to quote font names.","_yoast_wpseo_opengraph-title":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_twitter-title":"","_yoast_wpseo_twitter-description":""},"group":[19],"class_list":["post-830","glossary","type-glossary","status-publish","hentry","group-web-design"],"acf":{"cta":"Custom Web Design","faqs":[{"question":"Why is my font-family not working?","answer":"The usual causes: a misspelled font name (the browser skips it silently and moves down the list), malformed quoting or escaping, a custom font that never loaded via @font-face, or a more specific CSS rule overriding yours. Multi-word names may stay unquoted if they're valid identifiers; quoting avoids mistakes."},{"question":"Can I set font-family with the font shorthand?","answer":"Yes. The font shorthand sets style, weight, size, line height, and family in one declaration, such as font: italic bold 1.2em\/1.5 Georgia, serif;. Every part is optional except font-size and font-family, and the family list must come last."},{"question":"How many fonts should a font-family stack include?","answer":"CSS doesn't set a number. What matters is the order and the ending: per MDN, always include at least one generic family name, because no specific font is guaranteed to be available on a visitor's device. Name your first choice, then any fallbacks, with the generic keyword last."}],"term_definition":"font-family is the CSS property that sets which typeface an element's text uses. It takes a comma-separated list of font family names and generic family names in priority order: the browser applies the first font that is installed or downloadable and falls back down the list, so a generic family like sans-serif goes last as a safety net.","h2_more":"More About font-family","title_tag":"What is font-family in CSS?"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is font-family in CSS? - DreamHost Glossary<\/title>\n<meta name=\"description\" content=\"What is font-family in CSS? Learn how this property sets a prioritized font stack, why a generic fallback goes last, and when to quote font names.\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is font-family in CSS? - DreamHost Glossary\" \/>\n<meta property=\"og:description\" content=\"What is font-family in CSS? Learn how this property sets a prioritized font stack, why a generic fallback goes last, and when to quote font names.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dreamhost.com\/glossary\/web-design\/font-family\/\" \/>\n<meta property=\"og:site_name\" content=\"DreamHost Glossary\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-07T11:34:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dreamhost.com\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba.webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is font-family in CSS? - DreamHost Glossary","description":"What is font-family in CSS? Learn how this property sets a prioritized font stack, why a generic fallback goes last, and when to quote font names.","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"What is font-family in CSS? - DreamHost Glossary","og_description":"What is font-family in CSS? Learn how this property sets a prioritized font stack, why a generic fallback goes last, and when to quote font names.","og_url":"https:\/\/www.dreamhost.com\/glossary\/web-design\/font-family\/","og_site_name":"DreamHost Glossary","article_modified_time":"2026-08-07T11:34:08+00:00","og_image":[{"url":"https:\/\/www.dreamhost.com\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba.webp","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/glossary.dream.press\/glossary\/web-design\/font-family\/","url":"https:\/\/glossary.dream.press\/glossary\/web-design\/font-family\/","name":"What is font-family in CSS? - DreamHost Glossary","isPartOf":{"@id":"https:\/\/glossary.dream.press\/glossary\/#website"},"primaryImageOfPage":{"@id":"https:\/\/glossary.dream.press\/glossary\/web-design\/font-family\/#primaryimage"},"image":{"@id":"https:\/\/glossary.dream.press\/glossary\/web-design\/font-family\/#primaryimage"},"thumbnailUrl":"https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba.webp","datePublished":"2022-09-12T18:32:29+00:00","dateModified":"2026-08-07T11:34:08+00:00","description":"What is font-family in CSS? Learn how this property sets a prioritized font stack, why a generic fallback goes last, and when to quote font names.","breadcrumb":{"@id":"https:\/\/glossary.dream.press\/glossary\/web-design\/font-family\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/glossary.dream.press\/glossary\/web-design\/font-family\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/glossary.dream.press\/glossary\/web-design\/font-family\/#primaryimage","url":"https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba.webp","contentUrl":"https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2026\/08\/font-family-fallback-order-flowchart-dreamops-d916e33cb59c28effd11bdba.webp","width":1536,"height":1024,"caption":"Flowchart showing how a browser resolves the stack font-family: Helvetica, Arial, sans-serif. At each font the browser checks whether it is available: if yes, that font is used; if no, it moves to the next name, ending at the generic sans-serif keyword, which always applies as the safety net."},{"@type":"BreadcrumbList","@id":"https:\/\/glossary.dream.press\/glossary\/web-design\/font-family\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dreamhost.com\/glossary\/"},{"@type":"ListItem","position":2,"name":"Terms","item":"https:\/\/www.dreamhost.com\/glossary\/%group%\/"},{"@type":"ListItem","position":3,"name":"font-family"}]},{"@type":"WebSite","@id":"https:\/\/glossary.dream.press\/glossary\/#website","url":"https:\/\/glossary.dream.press\/glossary\/","name":"DreamHost Glossary","description":"","publisher":{"@id":"https:\/\/glossary.dream.press\/glossary\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/glossary.dream.press\/glossary\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/glossary.dream.press\/glossary\/#organization","name":"DreamHost","url":"https:\/\/glossary.dream.press\/glossary\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/glossary.dream.press\/glossary\/#\/schema\/logo\/image\/","url":"https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2022\/10\/dreamhost-glossary-social.jpg","contentUrl":"https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2022\/10\/dreamhost-glossary-social.jpg","width":2400,"height":1256,"caption":"DreamHost"},"image":{"@id":"https:\/\/glossary.dream.press\/glossary\/#\/schema\/logo\/image\/"}}]}},"lang":"en","translations":{"en":830,"es":1563,"fr":7921,"nl":7963,"it":8778,"pt":10127,"pl":10150,"de":10166,"ru":10390,"uk":10414},"pll_sync_post":{},"_links":{"self":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/glossary\/830","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/glossary"}],"about":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/types\/glossary"}],"wp:attachment":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/media?parent=830"}],"wp:term":[{"taxonomy":"group","embeddable":true,"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/group?post=830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}