Inline CSS Checker
Short answer
Detect excessive inline CSS that could affect performance and maintainability.
What It Does
Finds every inline style="" attribute and <style> block on your page. Reports how many there are and their total size, shows up to 8 example elements with their CSS, and suggests how to move the styles into a stylesheet.
Why It Matters
Inline style attributes cannot be cached separately, are hard to maintain and are blocked by a strict Content-Security-Policy unless you allow them explicitly. The exception is critical above-the-fold CSS in a <style> block, which can help the first render.
How It Works
-
Enter a page URL or paste its HTML
-
We fetch the page HTML and parse every <element style="">
-
Count inline style attributes separately from inline `<style>` blocks
-
Return the total inline CSS size, up to 8 example elements and refactoring advice
Sample input + output
url: https://rankproof.eu/tools
inline style="" attributes: 3 OK inline <style> blocks: 1 OK total inline CSS: 4.2 KB <div style="margin-top:12px"> <span style="color:#0EA5A4"> <p class="note" style="font-size:14px">
Who Uses This
-
Frontend Developer
Audit a legacy site for inline-style cleanup — extract patterns to utility classes to enable proper caching.
-
Security Engineer
Pre-CSP-deployment audit — every inline `style=""` blocks `style-src 'self'` policy. Extract them to enable strict CSP.
-
Performance Engineer
Inline CSS adds bytes to every HTML response. Move repeated patterns to a cached stylesheet — wins on every subsequent page load.
Frequently Asked Questions
Is inline CSS bad for SEO?
Not directly. It makes pages heavier and harder to maintain, and it gets in the way of a strict Content-Security-Policy.
When is inline CSS appropriate?
Critical above-the-fold styles in `<style>` tags (not `style=""` attributes), and dynamic per-component values that genuinely vary at runtime.
How do I refactor inline styles?
Identify repeated patterns → extract to utility classes → add to your stylesheet → replace inline `style=""` with `class=""`.
Does this break CSP?
Yes — strict CSP (`style-src 'self'`) blocks inline `style=""`. You'd need `'unsafe-inline'` or `'unsafe-hashes'` to allow it.
What about CSS-in-JS frameworks?
Many add <style> tags or style attributes while the page runs, which this tool does not see because it reads the HTML as delivered. Most can extract static CSS at build time, which is the better choice for production.