Magento 2 Add image in CSS background

Magento 2 Add image in CSS background

Share This

First we need to upload image in “app\design\frontend\vendor\theme\web\images” directory then write below code in css file.

background: url(‘@{baseDir}images/icon_cart.png’);

Then run below command in root directory.

– php bin/magento cache:clean
– php bin/magento setup:static-content:deploy

Hope this article is helpful for you.

Share This

Leave a Reply

Your email address will not be published. Required fields are marked *