Convert external CSS to inline styles in seconds. Perfect for email templates, legacy systems, and environments where inline CSS is required. Paste your HTML and CSS code, and instantly get HTML with all styles applied as inline attributes. Processing runs entirely in your browser—no data is uploaded to our servers.
The CSS to Inline Styles converter transforms external CSS rules into inline style attributes applied directly to HTML elements. This process is essential for email templates, legacy systems, and environments where external stylesheets cannot be used or are not supported.
Many email clients strip out external stylesheets and <style> tags from HTML emails. By converting CSS to inline styles, you ensure your styling is preserved in:
The tool follows these steps:
style attributesThe converter supports the most common CSS selector types:
p, div, h1.button, .highlight#header, #footerp.intro, div#main.btn.btn-primary[type="button"]Note: Complex selectors like pseudo-classes (:hover, :focus), pseudo-elements (::before), and descendant/child selectors are partially supported or converted to simpler matching rules.
The converter has two options for handling <style> tags embedded in your HTML:
<style> tags. This CSS is merged with any CSS you paste directly.<style> tags from the final output, leaving only inline styles on elements.Example: If your HTML contains:
<style>
.title { color: blue; font-size: 24px; }
p { color: gray; }
</style>
<h1 class="title">Hello</h1>
With extract enabled, the styles are automatically applied. With remove enabled, the output will have no <style> tag but the styles will be inlined on the <h1> element.
All standard CSS properties are supported, including:
color, background, background-colorfont-size, font-weight, line-height, text-alignmargin, padding, border, border-radiusdisplay, position, top, left, width, heightbox-shadow, text-shadow, opacitya:hover, input:focus cannot be converted to inline styles. Consider adding fallback CSS in a <style> tag if needed.@media rules are skipped during conversion.@keyframes and animations cannot be inlined.@font-face rules are not processed.When preparing HTML for email clients:
All processing runs entirely in your browser using client-side JavaScript. Your HTML and CSS are never uploaded to our servers and remain completely private.
Before:
<html>
<head>
<style>
.title { color: blue; font-size: 24px; }
p { color: gray; line-height: 1.6; }
</style>
</head>
<body>
<h1 class="title">Hello</h1>
<p>This is a paragraph.</p>
</body>
</html>
After Conversion:
<html>
<head></head>
<body>
<h1 class="title" style="color: blue; font-size: 24px;">Hello</h1>
<p style="color: gray; line-height: 1.6;">This is a paragraph.</p>
</body>
</html>