HTML_CSS : The Definitive Guide
|
HTML_CSS::toInline() allow to integrate html tags with styles.
![]() |
Warning |
|---|---|
| Dissociate html code and presentation layout (CSS) is more than recommanded |
Here is a basic example that show a white 'Hello World' on a black background :
<?php
require_once 'HTML/CSS.php';
$css = new HTML_CSS();
$css->setStyle('body', 'background-color', '#0c0c0c');
$css->setStyle('body', 'color', '#ffffff');
echo '<body style="' . $css->toInline('body') . '">';
echo '<p>Hello World</p>';
echo '</body>';
?>
| HTML_CSS : The Definitive Guide | v 1.0.0 : June 24, 2006 |