CSS → Inline-Styles Converter
Turn flat CSS rules into inline style attributes, one line per selector.
What this page computes
Paste CSS and the page prints, for each flat rule, its selector and the declaration block as a style attribute. .notice { color: red; margin: 0 } becomes .notice → style="color: red; margin: 0", with each declaration's spacing normalised.
Where it stops
Only flat rules are converted. An at-rule such as @media, @keyframes or a nested block is refused by name, because an inline attribute cannot carry a media query or a nested rule. A declaration with no colon is refused with the text that failed.
Why the answer repeats
Parsing and formatting are JavaScript in this tab, so a given stylesheet always prints the same attributes. Nothing is fetched, nothing is stored, and the page keeps working offline.
Turns each flat CSS rule into the inline style attribute its selector would carry and normalises the spacing inside every declaration. At-rules and nested blocks are refused by name; the output is markup to copy, not a rewritten document.
How to use it
Paste the stylesheet and press Run. Each output line names a selector and the style attribute it would hold.
The arithmetic
Declarations are split on semicolons and each is trimmed to `property: value`. Several selectors on one rule are printed separately because each element would carry the same attribute.
What to Expect
Best for
- preparing HTML for an email client
- reading a stylesheet as attributes
What this tool keeps
- one style attribute per selector
Sample input
.notice { color: red; margin: 0 }
Sample output
1 selector(s), 2 declaration(s) .notice → style="color: red; margin: 0"
Frequently asked questions
How do I use the css to inline styles page?
Paste flat CSS rules, then press Run. Each selector is printed with the style attribute it would carry.
Is anything uploaded?
No. The whole calculation runs in this tab with JavaScript: no request is made, no account is needed, nothing is stored, and the page keeps working offline once it has loaded.
What are its limits or bounds?
Every declaration must carry a colon and an at-rule must not appear: an inline style cannot hold @media, @keyframes or a nested block, so those are refused by name.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.