PHP - create clickable image for div class - need help!

Discussion in 'PHP' started by itsallwhite, Feb 27, 2010.

  1. #1
    Hi,

    I am trying to learn PHP but am getting confused with how to create a clickable image

    I want to create a clickable image in the sidebar of my website http://bodycleansediet.com.

    I have it looking fine in firefox but is messing up the entire page in IE. Its the box below the menu.

    The PHP is
    
    <div><img src="<?php echo TEMPLATE_DIR; ?>/images/spacer.gif" height="34" alt="spacer" /></div>
    
    <a href="http://cleansingdiet.info"<div class="isagenix"></div></a>
    
    <div><img src="<?php echo TEMPLATE_DIR; ?>/images/spacer.gif" height="34" alt="spacer" /></div>
    
    </div>
    Code (markup):
    The CSS is
    
    .isagenix {
    	background-image: url(images/isagenix_banner1.jpg);
    	background-repeat: no-repeat;
    	background-position: left top;
    	padding-top: 105px;
    	padding-left: 50px;
    	height: 100px;
    	font-family: "trebuchet MS";
    	font-size: 15px;
    	color: #000000;
    	text-decoration: none;
    	font-weight: bold;
    Code (markup):
    Can anyone give me advice on the best way to do this? your time is much appreciated!
     
    itsallwhite, Feb 27, 2010 IP
  2. GH Fever

    GH Fever Peon

    Messages:
    432
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well in HTML to make an image double as a link, you'd use the following code:

    <a href="website.com" target="blank"><img src="imagepath/image.jpg" border="0"></a>
    Code (markup):
    Now, I'm no PHP "expert", but I know PHP and HTML go hand in hand and from the looks of your code, you have the image above the link, you need to place your image in between the <a> tags.

    Good luck.
     
    GH Fever, Feb 27, 2010 IP
  3. Om ji Kesharwani

    Om ji Kesharwani Peon

    Messages:
    211
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Use the above code for all images...
    Then let me know..
    Thank u
     
    Om ji Kesharwani, Feb 28, 2010 IP
  4. itsallwhite

    itsallwhite Peon

    Messages:
    607
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for your assistance - think I got it now! just when I think i know a little about these things I realise I don't!
     
    itsallwhite, Feb 28, 2010 IP