← All tools

CSS Inliner

Move CSS declarations into HTML style attributes using selector specificity, source order and !important.

css-inlinerLOCAL WORKSPACE

Enabling local controls…

Runs locally without uploading or running your code. Each input accepts up to 128 KiB of UTF-8.

At-rules such as @media and dynamic selectors such as :hover stop conversion.

Inlined HTML

Enter your source or load the sample to get a result.

How to use this tool

Paste an HTML fragment or a standards-mode document. Unconditional embedded style blocks are processed in document order, then the optional CSS field. Existing inline declarations retain their normal precedence. The output is a snapshot for the supplied markup, with processed style blocks removed.

When not to use it

Supports type, class, ID, attribute and combinator selectors, plus :is(), :where(), :not(), :first-child, :last-child, :only-child, :empty and :root in a full document. Attribute value matching without i/s is limited to data-*, aria-*, id, class, style, href, src and title. At-rules such as @media, dynamic selectors, linked sheets, SVG and several conditional HTML constructs stop conversion. Fix the marked source or handle these styles in the original stylesheet. Review relative URLs and active markup before opening the downloaded HTML.