tijsverkoyen/CssToInlineStyles
tijsverkoyen/CssToInlineStyles has 5,817 GitHub stars and 192 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-11 03:24 UTC. Last push 2026-01-06.
CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very usefull when you're sending emails.
Measured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalCssToInlineStyles class
About
CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.
Installation
The recommended installation way is through Composer.
$ composer require tijsverkoyen/css-to-inline-styles
Example
use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;
// create instance
$cssToInlineStyles = new CssToInlineStyles();
$html = file_get_contents(__DIR__ . '/examples/sumo/index.htm');
$css = file_get_contents(__DIR__ . '/examples/sumo/style.css');
// output
echo $cssToInlineStyles->convert(
$html,
$css
);
Known issues
- no support for pseudo selectors
- no support for css-escapes
- UTF-8 charset is not always detected correctly. Make sure you set the charset to UTF-8 using the following meta-tag in the head:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />. (Note: using<meta charset="UTF-8">does NOT work!)
Sites using this class
- Each site based on Fork CMS
- Print en Bind
- Tiki Wiki CMS Groupware (starting in Tiki 13)
- Laravel Framework
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
561,871 starspublic-apis/public-apis
A collective list of free APIs
498,231 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
452,646 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,365 stars