use php variable in css

by Ramya 2013-10-05 19:13:22

You can use php variable in css, which is as follows,

<?php
header('Content-type: text/css');
$path = //image path;
?>
<style>
.imgg{
background-image:url('<?php echo $path; ?>/img.jpg');
}
</style>


you have to save this file with .php

Tagged in:

550
like
0
dislike
0
mail
flag

You must LOGIN to add comments