Login   Register  
PHP Classes
elePHPant
Icontem

File: simple_example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Arturs Sosins  >  CSS fix  >  simple_example.php  >  Download  
File: simple_example.php
Role: Example script
Content type: text/plain
Description: Simple example with CSS string
Class: CSS fix
Replace CSS properties with browser specific names
Author: By
Last change:
Date: 2012-04-07 07:28
Size: 1,142 bytes
 

Contents

Class file image Download
<?php
/************************************************************* 
 * This script is developed by Arturs Sosins aka ar2rsawseen, http://webcodingeasy.com 
 * Feel free to distribute and modify code, but keep reference to its creator 
 * 
 * CSSfix class can automatically apply vendor prefixes to specified CSS rules.
 * It also applies other fixes, for different CSS browser specifics.
 * 
 * For more information, examples and online documentation visit:  
 * http://webcodingeasy.com/PHP-classes/Automatically-add-CSS-vendor-prefixes
**************************************************************/
 
//declaring class instance
include("./CSSfix.php");
$css = new CSSfix();
$before "
div
{
    border-radius: 10px;
}
div
{
    box-shadow: #123456 0 0 10px;
}
div.someclass
{
    display: box;
    opacity: 0.5;
}
"
;

$css->from_string($before);

$after $css->generate(false);

echo 
"<table border='1px' cellpadding='10'>";
echo 
"<tr>";
echo 
"<td style='vertical-align: top;'><p>Before: </p><pre>".$before."</pre></td>";
echo 
"<td><p>After: </p><pre>".$after."</pre></td>";
echo 
"</tr>";
echo 
"</table>";