Menu

A silent CSP bug that broke our homepage layout (and the fix)
πŸ“°

A silent CSP bug that broke our homepage layout (and the fix)

DEV Community: cssΒ·Fuad TanirverdiyevΒ·7 days ago
#SgkPpxQG
#devtocss#devto#dev#inline#real
Long article (714 words) β€” no AI summary yet.
Reading 0:00
15s threshold

I spent part of this week chasing a layout bug that only showed up in real browsers, never in local dev previews, and never threw a single console error. Here's what was actually going on, and the fix.

The symptom

On the homepage of BrightLoop (a small agency I run, building websites, AI chatbots, and business automation for small businesses, in EN/DE/AZ, on Cloudflare Workers), I had a handful of decorative floating cards positioned over a hero section. Each card had its position set with an inline style attribute, computed server-side per card:

<div class = "hero-card" style = "top: 12%; left: 68%; transform: rotate(-4deg);" > ... </div>

Enter fullscreen mode

Exit fullscreen mode

Locally, in dev, they rendered exactly where they should. Deployed, in every real browser, they all collapsed to the same spot β€” top-left, no rotation, stacked on top of each other.

The investigation

First instinct: broken CSS cascade, or a stale build. Neither.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.