Jump to content

[solved] Add link to background image in global.css


Recommended Posts

Hi folks....

 

I am using Prestashop 1.5.2 and have successfully added a background image to my site so that it appears at the top of each page.

 

I edited global.css and added the line below:

 

 

generic style

************************************************************************************************ */

body{

font:normal 11px/14px Arial, Verdana, sans-serif;

color:#222;

background:#fff

 

url(/img/newsletter.jpg) 50% 2% no-repeat;

 

}

 

I would now like to attach a link to this image. I have done some searching on this forum and the web but cannot get a solution working.

 

Has anyone here successfully done this or have an idea?

 

Thanks....Dave

Link to comment
Share on other sites

Hi there....

 

I have placed the image at the top center of my site next to the store logo - it is an image that invites visitors to sign up for my newsletter. The image is very prominent which is what I want.

 

I can place the image exactly where I want it by using the code I placed in the global.css file. The problem is that I cannot figure out how to make the image clickable in the traditional html manner with <a href></a> tags. The intention is for the destination to be the email list provider's signup page when users click the image.

 

Hopefully this helps explain what I am after.

 

Thanks....Dave

Link to comment
Share on other sites

Hi Stransky,

CSS is meant to do the layout of your site, not really to add functionality to it.

 

Maybe a better way is to add the picture in the header.php file. Something like this:

 

Open file /themes/<your them folder>/header.php and add the red text:

(you can of course move the image around a little, (and change the picture ;-) ))

 

 

{$HOOK_HEADER}

<div ID="absolutelogo" style="position:absolute; width:100%; min-width:980px;" >

<a href="http://PrestaShop.com"><img src="http://i1164.photobucket.com/albums/q561/Pascalvangeest/facebookb_zps293f6f0a.png" alt="Facebook" style="position:absolute; top:120px; left:50%; z-index:9999;"></a>

</div>

</head>

 

 

 

N.B. The <div> is used to move the picture when resizing the window. The picture above is placed in the middle. Just change the left:50% to move it left or right. The z-index puts the picture on top

 

 

Hope this does the trick,

pascal

Link to comment
Share on other sites

Hello Pascal....

 

Sorry, should have taken the time to investigate before responding previously.

 

I put the changes you suggested in /themes<my theme>/header.tpl and made the required adjustments for link, image and placement. It worked out great!

 

Thanks so much for your help!

 

Cheers....Dave

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...