PHP code cannot work in a .cssfile, however you can use the inline style, for example:
<div style="background-image: url("<?php
or
<style>
.class-name {
background-image: url("<?php //url ?>");
}
</style>
The above would be useful when working with custom fields for dynamic image paths.
, PHP , , /theme-name/images, /theme-name/style.css, css :
.class-name {
background-image: url("images/file.jpg")
}