I want to add background image for <li>
element in template file. How to add background image in phtml file in magento2 ?
1 Answer
Try the below code:
<li style="background-image:url('<?php echo $block->getViewFileUrl('images/demo.jpg'); ?>')">Your text</li>