PHP Classes

Inline Style: Apply stylesheets to HTML as tag style attributes

Recommend this page to a friend!
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 49%Total: 548 All time: 5,528 This week: 488Up
Version License PHP version Categories
inline-style 0.1MIT/X Consortium ...5HTML


This class can be used to apply style sheets to HTML as tag style attributes.

It parses an HTML document, finds external or inline style sections, and applies the defined styles to tags that match the defined style selectors to make the tags use style attribute instead.

Innovation Award
PHP Programming Innovation award nominee
April 2010
Number 9

Prize: One book of choice by Packt
CSS stylesheets can be used to define presentation details of elements in pages.

However, in certain cases it is not possible to use external CSS stylesheets to define the page presentation.

That is the case of certain Web mail systems, like for instance Gmail, that discard all stylesheets used in an HTML e-mail message.

This class provides an alternative solution for using CSS stylesheets in HTML e-mail that works even with systems that disable CSS stylesheets in the messages.

It processes the CSS stylesheets and alter the HTML to apply the styles in each page tag setting their style attributes.

Manuel Lemos
Picture of Christiaan Baartse
Name: Christiaan Baartse <contact>
Classes: 4 packages by
Country: The Netherlands The Netherlands
Age: 38
All time rank: 138638 in The Netherlands The Netherlands
Week rank: 346 Up9 in The Netherlands The Netherlands Up
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Plain text file CSSQuery.php Class Dependency for main class
Plain text file InlineStyle.php Class Main Class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:5,528
This week:488Up
 User Ratings  
 All time