Last updated: November 30, 2026.
For a stylesheet served from a different origin, use crossorigin="anonymous" on the link with integrity. The CDN must also send a CORS response header that permits the page’s origin.
<link rel="stylesheet"
href="https://cdn.example.com/assets/theme.css"
crossorigin="anonymous"
integrity="sha384-/4MmmxP1gpGw7FUnYgj80eE5W/HrnbRM9UzVwwf48ChvXxtzJCWK4RPTkctN1l3C">Check the generated link and response headers
Inspect the actual link in the browser, including links inserted by JavaScript. With a CDN URL, the browser needs a CORS-enabled response to check the stylesheet digest. For a public stylesheet, the CDN can return Access-Control-Allow-Origin: * for this anonymous request. It can also return the specific page origin. If it selects the header dynamically, configure caches to distinguish requests by Origin.
Check the final stylesheet response in the Network panel. A successful HTTP status by itself does not establish that the stylesheet is usable. A response the browser cannot read through CORS is ineligible for the integrity check.
Check the digest separately
The example digest corresponds to the UTF-8 bytes of body { color: navy; } followed by a single LF. Use your build’s digest for your own resource. Recompute it from the deployed stylesheet if CORS is working but the browser still reports an integrity mismatch. A stale CDN object, changed line endings or a minification step after hashing can change the bytes.
If Symfony AssetMapper produces the stylesheet link, check both server-rendered links and links added by its JavaScript loader. Use a framework release or renderer configuration that emits the needed attribute, or serve the stylesheet from the page’s origin while retaining integrity. Test the rendered page again after deploying both the asset and its metadata.