This is ok as long as its in a php file (with .php extension)
<div class="box <?php echo $something ; ?>">
This however,
.sample-<?php echo $something; ?> {
/* CSS Styles */
}
Please never do this. There’s really no reason to. Furthermore, the purpose of CSS is for styling your webpage not handling server side scripts
3
solved Using php in CSS ID/Class name [closed]