Jump to content

Background image, hot to make it responsive and only for the home page


Recommended Posts

Hello, I managed to add a background image to a shop by pasting:

body, #page, header, .columns-container {
background: #FFF url('../img/background.jpg') no-repeat !important;
}
to the global.css (under body) file located in default-bootstrap\css  and by previously adding the /background.jpg image to the themes\default-bootstrap\img folder.
 
Question is, how could I make that this image is shown in the home page only, and how to make it reponsive so that it adapts on size to the screen of cell phones and tablets?
 
It is a hard one, but a very useful one. Thanks in advance if you can solve the puzzle!
Edited by HHServices (see edit history)
Link to comment
Share on other sites

  • 1 month later...
Hi,

 

In Prestashop 1.6.X, you can do this by adding CSS for home page only.

 

To check home page you can use PHP variable "$page_name" as -

 



<?php
if ($page_name == 'index') {
 //Add you style code here
}
?>



 

To Put any piece of code on any page there is a module for that it will definitely help you a lot.

 


 


 

In case, of any query or confusion, please feel free to ask.

Edited by Knowband Plugins (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...