Skip to content
TheCoachSMB
  • Follow Us:
Email: info@gmail.com
Call: +123-456-7890
TheCoachSMB

We Make It Happen

  • Blog
    • Magento2
    • HTML5
    • PHP Tutorial
  • Our Courses
  • Services
    • Magento 2 Installation Service
    • Magento Development Services
    • Support & Maintenance Services
    • Migration Services
    • Magento 2 Upgrade Service
    • Magento Security Patches
    • Magento Site Audit
    • Magento Speed & Performance
    • Magento Extension Development
    • Magento Consulting Services
    • SEO Services
    • Designing Services
  • Book A Call
  • Profile
  • About Us

    Lorem Ipsum is simply dummy text of the printing and typesetting industry.

    Contact Us
    Contact Info

    684 West College St. Sun City, United States America, 064781.

    (+55) 654 - 545 - 1235

    info@gmail.com

  • Get In Touch
  • Follow Us:
Email: info@gmail.com
Call: +123-456-7890
TheCoachSMB

We Make It Happen

  • Get In Touch
  • Blog
    • Magento2
    • HTML5
    • PHP Tutorial
  • Our Courses
  • Services
    • Magento 2 Installation Service
    • Magento Development Services
    • Support & Maintenance Services
    • Migration Services
    • Magento 2 Upgrade Service
    • Magento Security Patches
    • Magento Site Audit
    • Magento Speed & Performance
    • Magento Extension Development
    • Magento Consulting Services
    • SEO Services
    • Designing Services
  • Book A Call
  • Profile

Change background image of the page in Magento2

  • Home
  • Change background image of the page in Magento2
  • Sonal Motghare-Balpande Sonal Motghare-Balpande
  • Jun, Tue, 2021
  • Magento 2
Change background image of the page in Magento2

Table of Contents

  • Step1 : _theme.less and _extend.less file
  • Step2: Upload background image
  • Step3: Add background image code in _theme.less file
  • Step4: Add reference in the _module.less file
  • Step5: Deploy changes on the site

In this article, we are going to understand how to change the background image of the page in Magento.

Requirement for performing this step is you must have your own theme or you can have installed theme in the Magento2 project.

Tip:- The core files of Magento2 should not be modified for any work. Do not modify core files.

This can be achieved by following below steps:

Step1 : _theme.less and _extend.less file

Step2: Upload background image

Step3: Add background image code in _theme.less file

Step4: Add reference in the _module.less file

Step5: Deploy changes on the site

Lets start with the Step 1.

Step1 : _theme.less and _extend.less file

In this step, copy _theme.less and _extend.less file from your parent theme Ex. [Magento_Luma_Theme_Path]/web/css/source/_theme.less and [Magento_Luma_Theme_Path]/web/css/source/_extend.less

and paste these file in your current theme app/design/frontend/Vendor/Theme/web/css/source/

[Magento_Luma_Theme_Path]:=> <magento_root_dir>\vendor\magento\theme-frontend-luma\web\css\source

 

Step2: Upload background image

Here we will put the background image in the path – C:\xampp\htdocs\magento2\app\design\frontend\Vendor\Theme\web\images

 

Step3: Add background image code in _theme.less file

Update the _theme.less file of app/design/frontend/Vendor/Theme/web/css/source/

with the content –

@page__background-image:url('../images/bg.jpg');

 

Ex: – bg.jpg is the background image name

Step4: Add reference in the _module.less file

In this step, copy _module.less file from C:\xampp\htdocs\magento2\vendor\magento\theme-frontend-luma\Magento_Theme\web\css\source

to C:\xampp\htdocs\magento2\app\design\frontend\Vendor\Theme\Magento_Theme\web\css\source

Update the _module.less in your theme with the below content–

Add the highlighted line.
& when (@media-common = true) {


body {

.lib-css(background-color, @page__background-color);

      .lib-css(background-image, @page__background-image);

}

Step5: Deploy changes on the site

Let first remove directories contents /pub/static/frontend/Vendor/Theme/en_US and  var/view_preprocessed.

and then Run the below command to compile static contents.

php bin/magento cache:flush

php bin/magento setup:static-content:deploy –f

 

All set, let go the browser, hit your base url and see the magic

Comment below for the feedback and for any help.

Happy Learning !

Thank You !

Related Posts:

  • Events and Observers in Magento2
  • HTML5
  • Install Magento 2 on Ubuntu 21.04 [Complete Guide]
  • PHP: How to install intl extension on CentOS
  • Magento 2 Useful Commands List 2022
  • Install Magento 2.4.7 on Ubuntu 22.04 [Complete Guide]
Comments (0)
Sonal Motghare-Balpande

Hello Readers, My passion is to guide people by sharing the knowledge I have. If I can contribute even little to the people life, its very big achievement for me. Thank You, Sonal

Leave a Reply Cancel reply

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

Search
Recent Posts

  • Install/debug Magento2 delivery date extensionNovember 18, 2024
  • Install Magento 2.4.6 on Ubuntu 22.04 [Complete Guide]October 16, 2024
  • Install Magento 2.4.7 on Ubuntu 22.04 [Complete Guide]October 16, 2024
Categories

  • Accounting
  • Agency
  • Business
  • Consultant
  • Finance
  • Investment
  • Magento 2
  • Masonry
Calendar
May 2025
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Nov    
Tags

6 Steps to Install Magento 2 on XAMPP Windows Using Composer Agency Business composer install magento 2 download xampp for windows Graphics how to install magento how to install magento2 in localhost how to install magento2 in localhost ubuntu how to install magento2 in localhost wamp how to install magento 2 in windows 10 How To Install Magento2 in Windows on localhost using Xampp how to install magento 2 on xampp How to install Magento 2 using Composer in windows How to install Magento 2.4 in localhost XAMPP how to install magento 2.4 on xampp install magento 2 in windows10 install magento 2 using composer install magento 2 using composer windows install magento 2 windows xampp install Magento 2 with Sample Data install magento2.4 Install Magento 2.4 xampp windows 10 install magento 2.4.3 install magento2.4.3 install xampp on windows 10 Latest magento2 magento 2 composer install magento 2 install magento2 install magento 2 installation magento 2 installation steps magento 2 installation using composer magento 2 system requirement magento2.4 magento2.4.3 magento download magento for windows magento installation on xampp Magento with windows magneto2 Multisite thecoachsmb xampp download

LATEST BUSINESS IDEAS

Subscribe to Our Newsletter
& Stay Update

Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.

Thank you to visit our site and doing business with us.

We give our 100% to help you and to grow together.

About Us

Ready To Start Work With Us?

Felis consequat magnis est fames sagittis ultrices placerat sodales porttitor quisque.

Get a Quote
Contact Us
  • Courses
  • Blog
  • Magento2 Tutorial
  • Shop
Quick Links
  • Appointment
  • Price Plans
  • Investment Strategy
  • Financial Advices
  • Strategy Growth
  • Services
  • Business Planning
Links
  • Privacy Policy
  • Terms and Conditions
  • My Account
  • Contact Us
  • About Us
Latest Posts
  • Install/debug Magento2 delivery date extensionNovember 18, 2024
  • Install Magento 2.4.6 on Ubuntu 22.04 [Complete Guide]October 16, 2024
  • Install Magento 2.4.7 on Ubuntu 22.04 [Complete Guide]October 16, 2024
Open Hours

Our support available to help you.

  • Monday-Friday: 10am to 10pm
  • Email: support@thecoachsmb.com
  • Call: +91 7020500374
Opening Hours
Week Days 10:00 - 17:00
Saturday 10:00 - 15:00
Sunday Day Off
Contact us
Copyright © 2025 TheCoachSMB
🚀 Let’s Connect on LinkedIn! 🚀

Want to level up your skills and knowledge? 🚀
Follow us on LinkedIn to get:
✅ Expert insights on business growth
✅ Daily tips to sharpen your skills
✅ Exclusive updates from The Coach SMB

Let's grow together!

Follow me on LinkedIn

No thanks, I’m not interested!

WhatsApp

WhatsApp

Skype

Skype

Hide