There is the following css style:

?> <style> .fon2{ background: url(<?=$leff?>) no-repeat; border: 1px solid #d6d6d6; padding: 5px 5px 5px 5px; margin-right:4px; color: #898989; font-size: 11px; width: 96%; } </style> <? 

How to make the $leff variable inside the <style> work?

    2 answers 2

    Obviously, the extension is not .html, but .php

     <? $leff = 'no-img.jpg'; ?> <style> .fon2{ background: url(<?=$leff?>) no-repeat; border: 1px solid #d6d6d6; padding: 5px 5px 5px 5px; margin-right:4px; color: #898989; font-size: 11px; width: 96%; } </style> 

      Denis. Your code only works in the style of adding the height of the image, for example height: 50%; and specify the correct address of your picture.

       .fon2{ background: url(<?=$leff?>) no-repeat; border: 1px solid #d6d6d6; padding: 5px 5px 5px 5px; margin-right:4px; color: #898989; font-size: 11px; width: 96%; height: 50%;}