[eluser]Byzs[/eluser]
Hello to everybody, this is my first time in the forums and couldn’t look for a solution here or in the internet.
So, first i was looking for a solution on how to insert php code into my css file, i found this:
1) Name your .css file as .php file
2) At the top of the file specify the mime type as a text/css like this:
Code:
<?php
$mtype = "text/css";
header("Content-Type: $mtype");
?>
3) load your style.css file as style.php from your view and done !
It works like charms, but i have a little problem when i’am try to load a config variable into a css section, like this:
Code:
#form_container
{
background:#fff;
margin:0 auto;
text-align:left;
width:<?php echo $this->config->item('width');?>px;
}
Everything goes wrong and the style is not loaded at all.
Any ideas would help !
Sorry for my bad english.