Jump to content

Cannot centre Banner Block


Fletcher91

Recommended Posts

Hi, I am having trouble centering an image at the top of my prestashop website (see attached screen shot).

 

I have tried placing this in global.css:

 

#header .banner a img {
  display: block;
  width: 100%;
  height: 100%;
 }
 
.banner .container, header .banner a {max-width:100%!important; width:100%!important;}
 
 
And the image is large enough to completely fill the width, but it is not.
 
It is a module called "Banner Block"
 
Would really appreciate some help with this :)

post-727424-0-61098800-1486986945_thumb.png

Link to comment
Share on other sites

In your theme's header.tpl file you'll see that the Banner Block puts its image in container and row elements:

<div class="banner">
    <div class="container">
        <div class="row">
            {$smarty.capture.displayBanner}
        </div>
    </div>
</div>

The container is going to restrict the wdith of the image.

 

Futhermore, blockbanner.css contains css which will also restrict the width of the image.

Edited by JeredBolton (see edit history)
  • Like 1
Link to comment
Share on other sites

Thanks. I have found a deleted:

 

<div class="banner">

<div class="container">

<div class="row">

{$smarty.capture.displayBanner}

</div>

</div>

</div>


But it has not fixed the issue :/ Do you have anymore suggestions? Thanks for your help and time. (If this helps, there was a default image when I first started on the site and that image displayed correctly. Problem only happened when I replaced it with my own image).

Link to comment
Share on other sites

Deleting that block of code will remove the banner completely.

 

To remove just the container remove the lines highlighted below:

 

<div class="banner">
    <div class="container">
        <div class="row">
            {$smarty.capture.displayBanner}
        </div>
    </div>
</div>
  • Like 1
Link to comment
Share on other sites

Make the change to the header.tpl file as per a previous post.

 

In css/modules/blockbanner/blockbanner.css in your theme's directory, delete the following lines:

 

#header .banner a {                                                           
  display: block;                                                             
  max-width: 1170px;                                                          
  max-height: 65px;

}                                                         
                                                                              
#header .banner a img {                                                       
  display: block;                                                             
  width: 100%;                                                                
  height: 100%;                                                               
  max-height: 65px;                                                           
  max-width: 1170px;

}

 

Make sure you don't delete the closing curly brace on the second block of code.

  • Like 1
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...