javascript - How do you use php variables in css properly? -


i have variables in php want use in css, how go in using these in css ?

-webkit-clip-path: inset(0 1500px ("<?php echo $y; ?>") 0); -moz-clip-path: inset(0 1500px ("<?php echo $y; ?>") 0); -o-clip-path: inset(0 1500px ("<?php echo $y; ?>") 0); clip-path: inset(0 1500px ("<?php echo $y; ?>") 0); 

this doesnt seem work, or without quotes around .

you can't render php inside of .css file. should use inline styles in html that's generated php file.

that direct answer question. indirect answer:

use sass or less. they're designed doing want here: using variables in css.


Comments