How to use plugins_url() inside PHP stylesheet file [duplicate]

Try

background:url(<?php echo plugins_url().'/myimgfolder/my_img.png'; ?>) no-repeat <?php echo $x_position.' '.$y_position; ?>;

It will allow you to echo the PHP elements into your style.

EDIT:

You also need to close the file, you’re trying to mix unwrapped PHP with your CSS. Your PHP variables aren’t escaped either. I’ve tested the code below, and it works fine:

<?php
    header('Content-type: text/css; charset: UTF-8');
    $x_position = 0;
    $y_position = '-40px';
?>
.blugin_box{
    width:140px;
    height:140px;
    background:url(<?php echo plugins_url().'/myimgfolder/my_img.png'; ?>) no-repeat <?php echo $x_position.' '.$y_position; ?>;
}

I suggest using:

error_reporting(E_ALL);
ini_set('display_errors', 1);   

While you’re debugging so that you can see any PHP errors on screen, or check your log files 🙂