Jump to content

Image link is not working for me


newcoder1010

Recommended Posts

Hello, 

I have this php code. I can only click part of the image not the entire image. Am I writing it in correct format?

 

<a class="logo" href="/"  title="<?php print t('Home'); ?>">        <img  src="<?php $logo1 = "images/logo2g-245x128-6.png";
		print $logo1; ?>" alt="<?php print t('Home'); ?>" />
      </a>

Please advise. 

Link to comment
Share on other sites

Hello newcoder100

if you want display an image from one of your directory

just do

<a class="logo" href="/"  title="yourTitle">   <img  src="../images/logo2g-245x128-6.png" alt="yourTitle" />
      </a>

where php file is in one directory and an image is  in an other.

Like that you can click on the entire image

Hope it's helps you

Link to comment
Share on other sites

Yes using drupal. 

I added this code. Two places. One is main logo link on the top bar. Still have issue. The other one is on the sidebar. That works fine. I am not sure why. 

 

<a class="logo" href="/"  title="psarl">   <img  src="/assets/images/logo2g-245x128-6.png" alt="psarl" />
      </a>

My page

Link to comment
Share on other sites

If you can only click on part of the image it's not a PHP issue, it's a CSS issue.  There's probably another element covering part of the image.  You can use your browser's developer tools to look at the elements and see what's going on.

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