Skip to main content

Why Is My Custom Font Not Working in CSS 2026 ?

Custom font not working in CSS? Fix @font-face errors, wrong file paths, CORS issues, font weights and browser fallback problems.

12 November 2026

Why Is My Custom Font Not Working in CSS

If your custom font is not working in CSS, the most common causes are an incorrect font file path, a mismatched font-family name, a failed font request, or a browser fallback. Problems with @font-face declarations, CORS permissions, and font weights can also prevent the expected typeface from appearing.

The fastest solution is to check your CSS declaration, inspect the font request in Chrome DevTools, and confirm which font actually renders. This guide walks through the fixes with practical examples.

Quick Answer: How to Fix a Custom Font Not Working

Start with this troubleshooting checklist:

  1. Check that the font file exists at the specified URL.
  2. Verify that the @font-face declaration is valid.
  3. Make sure font-family names match.
  4. Confirm the CSS stylesheet is loading.
  5. Check Chrome DevTools for failed font requests.
  6. Investigate CORS errors for externally hosted fonts.
  7. Verify the requested font weight and style.
  8. Check whether Chrome is displaying a fallback font.

If you're unsure which typography properties are applied to an element, the FontFinder Chrome extension can help inspect its font family, weight, size, and other CSS values.

1. Check Your @font-face CSS Syntax

The @font-face rule tells the browser where to find a custom font and which family name to associate with it.

Here's a basic working example, assuming the specified file exists:

@font-face {
  font-family: "MyCustomFont";
  src: url("/fonts/my-font.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: "MyCustomFont", Arial, sans-serif;
}

This declaration registers the font, while the body rule applies it to the webpage.

Common @font-face Mistakes

  • Missing the font-family descriptor.
  • Incorrect src syntax or quotation marks.
  • Using an invalid file URL.
  • Forgetting to apply the declared family to an element.
  • Using an unsupported or corrupted font file.

Importantly, declaring a font through @font-face doesn't automatically apply it to your website.

For the complete syntax, see MDN's official @font-face documentation.

2. Fix an Incorrect Font File Path

A wrong URL is one of the easiest mistakes to make when loading custom fonts.

For example, suppose your project contains:

project/
  css/
    style.css
  fonts/
    my-font.woff2

From the CSS file, a relative path would normally be:

src: url("../fonts/my-font.woff2") format("woff2");

The two dots move up one directory before entering the fonts folder.

How to Verify the Font URL

  1. Open Chrome DevTools.
  2. Select the Network tab.
  3. Reload the webpage.
  4. Filter requests by Font.
  5. Locate the requested font file.
  6. Check its response status.

A 404 response usually indicates that the requested resource wasn't found. A 403 response can indicate an access restriction.

Remember that relative URLs inside CSS are generally resolved relative to the stylesheet URL, not the HTML document.

3. Make Sure the Font Family Names Match

The name declared in @font-face must match the family referenced by the element's CSS.

For example:

@font-face {
  font-family: "BrandFont";
  src: url("/fonts/brand.woff2") format("woff2");
}

h1 {
  font-family: "BrandFont", sans-serif;
}

If your heading instead requests another family name, it won't select the registered font.

Also check whether an existing CSS rule overrides your declaration. A more specific selector, a later rule, or an important declaration may control the final styling.

For deeper font-property inspection, read FontFinder's guide to identifying font family, size, weight, and color.

4. Check Whether Your CSS File Is Loading

Sometimes the font file is correct, but the stylesheet containing its declaration isn't being applied.

Open DevTools and inspect the element. If your intended CSS rule doesn't appear in the Styles panel, investigate whether the stylesheet loaded successfully.

Common causes include:

  • An incorrect stylesheet URL.
  • A missing CSS import.
  • A build process excluding the stylesheet.
  • A media query that doesn't match.
  • An overridden font-family declaration.

Temporarily changing an easily visible property, such as a heading's color, can help verify whether the stylesheet affects the page.

Remove temporary debugging styles after testing.

5. Fix CORS Errors When Loading Fonts

Cross-Origin Resource Sharing, or CORS, becomes important when your font files are hosted on another domain or origin.

For example, your website might load a font from a separate CDN.

If the server doesn't provide the necessary access permissions, the browser can block the font request.

How to Recognize a Font CORS Error

Open the DevTools Console and look for messages mentioning Cross-Origin Resource Sharing or Access-Control-Allow-Origin.

To fix the problem:

  1. Identify the origin serving the font.
  2. Check the browser's error message.
  3. Verify the server's CORS response headers.
  4. Allow the appropriate website origin.
  5. Reload the page and inspect the request again.

Configure the permissions on the font-hosting server rather than trying to bypass browser security.

See MDN's CORS documentation for implementation details.

6. Check the Font Weight and Style

A custom font may load successfully but appear different because the requested weight or style doesn't match its @font-face definition.

Suppose you have separate Regular and Bold files. Register them under the same family with their corresponding weights:

@font-face {
  font-family: "BrandFont";
  src: url("/fonts/regular.woff2") format("woff2");
  font-weight: 400;
}

@font-face {
  font-family: "BrandFont";
  src: url("/fonts/bold.woff2") format("woff2");
  font-weight: 700;
}

h1 {
  font-family: "BrandFont", sans-serif;
  font-weight: 700;
}

If the bold file is missing, the browser may synthesize a weight or choose another available face.

For variable fonts, confirm that your @font-face descriptors correctly describe the supported weight range.

7. Understand Why the Browser Uses a Fallback Font

Even when CSS specifies a custom typeface, Chrome may display another font.

This can happen because the font didn't load, lacks required characters, or wasn't selected by the browser's font-matching process.

How to Find the Actual Rendered Font

  1. Right-click the affected text.
  2. Select Inspect.
  3. Open the Computed tab.
  4. Find the Rendered Fonts section.
  5. Check which typefaces actually display the text.

This is more reliable than checking only the computed font-family property, which can contain several fallback choices.

For faster inspection of declared typography properties, use FontFinder. For definitive rendered-font information, use Chrome DevTools.

8. Fix a Custom Font That Works Locally but Not Online

If your custom font works during local development but disappears after deployment, check the production environment.

Frequent causes include:

  • Font files missing from the deployment.
  • Incorrect public asset paths.
  • Case-sensitive filename mismatches.
  • CDN configuration issues.
  • CORS restrictions.
  • Outdated cached CSS files.

For example, a filename that works on a case-insensitive local filesystem may fail when deployed to a case-sensitive server.

Compare the exact production URL with the file location and inspect the live network request.

After fixing the issue, refresh the page and verify that the intended font is rendering.

9. Fix Custom Fonts Not Working on Mobile

If your font works on desktop but not on mobile, investigate the mobile browser rather than assuming the font file is universally supported.

Check whether:

  • The font request succeeds on the device.
  • The required characters exist in the font.
  • Mobile-specific CSS overrides the family.
  • The requested font style is available.
  • Network conditions affect loading.

A responsive stylesheet may contain a different font-family declaration under a media query.

Use mobile browser debugging tools or Chrome's device emulation to investigate layout-specific CSS. Remember that device emulation doesn't reproduce every real-device font or rendering difference.

10. Fix Fonts That Flash or Change After Loading

Sometimes the custom font appears only after a delay. This may be expected web-font loading behavior rather than a broken CSS declaration.

The font-display descriptor controls aspects of how text appears while a web font loads.

For example:

@font-face {
  font-family: "BrandFont";
  src: url("/fonts/brand.woff2") format("woff2");
  font-display: swap;
}

The swap value allows fallback text to appear while the custom font loads, then replaces it when the font becomes available.

This can improve initial text visibility but may create layout changes when the fonts have different metrics.

For performance optimization after resolving loading errors, read FontFinder's Font Loading Strategies guide.

How to Test Whether a Custom Font Loaded

Chrome's Console also provides access to the CSS Font Loading API.

For a font defined and used on the current page, you can try:

document.fonts.check('16px "BrandFont"');

This checks whether the relevant font faces are available for the specified font request.

However, a true result doesn't always prove that a specific character was rendered using your custom font, particularly when no matching face is registered.

Use Rendered Fonts for final visual confirmation.

How to Check Font Files Before Uploading

Sometimes the issue comes from the font file itself rather than CSS.

Before investigating complex browser behavior, verify that the file is valid and supports the characters your website needs.

You can use FontFinder's free typography tools, including its Font File Analyzer, to inspect supported font formats and metadata.

Check the font's family information, supported characters, and available styles. Also ensure that your license permits website embedding.

Font inspection doesn't replace browser testing, but it can help identify problems before deployment.

Common Custom Font Errors and Their Fixes

  • 404 Not Found: Correct the font URL or deployment path.
  • CORS blocked: Configure the font server's allowed origins.
  • Wrong font displayed: Inspect family names, overrides, and rendered fonts.
  • Only regular weight works: Register the correct weight files or variable range.
  • Missing characters: Check glyph coverage and fallback fonts.
  • Font changes after loading: Review font-display behavior and fallback metrics.

Resolve the specific error before making unrelated changes to your typography system.

Frequently Asked Questions

Why is my custom font not working in CSS?

Common causes include wrong file paths, incorrect @font-face syntax, mismatched font-family names, missing files, CORS errors, and CSS overrides. Check the browser Console and Network panels first.

Why is @font-face not working?

The font source may be inaccessible, the declaration may be invalid, or the registered family may not be applied to the element. Verify the source URL and CSS rules.

Why is my WOFF2 font not loading?

Check whether the file exists, downloads successfully, and is valid. Also inspect CORS restrictions, server responses, and the @font-face source declaration.

Why does my font work in Chrome but not another browser?

Different browsers may expose issues involving font support, fallback selection, file handling, or CSS behavior. Compare browser errors and verify supported font formats.

How do I know which font Chrome actually uses?

Open Chrome DevTools, inspect the text element, select Computed, and check Rendered Fonts. This reveals which typefaces render the selected text.

Should I use WOFF2 for custom website fonts?

WOFF2 is generally a strong choice for modern web-font delivery because of its compression. Ensure the font file is valid and your target browsers support the format.

Final Thoughts

When a custom font isn't working in CSS, begin with the simplest checks: verify the file URL, inspect @font-face, confirm the family name, and review browser errors.

If everything appears correct but the typography still looks wrong, check Chrome's actual rendered fonts and investigate possible fallback behavior.

Use FontFinder to inspect live website typography, and combine it with DevTools when diagnosing font-loading problems. This approach can help you identify the cause without unnecessary trial and error.