CSS file does not get parse as PHP file. If you really want to do something like that, rename your file as styles.php
OPEN the page and add
header("content-type: text/css");
This tells the page to be treated as a text based CSS file. Then you can simple echo your remaining CSS like
echo "
body {
....
....
";
To fix the base_url()
not being accessible from styles.php
set a session variable to keep that. You can keep this on your index.php
of codeignitor.
$_SESSION['base_url'] = base_url();
Now, use this inside styles.php
.
background: url("<?php echo $_SESSION['base_url']; ?>"/../../some.jpg");