jousley Posted June 18, 2007 Share Posted June 18, 2007 I think might be an easy question. But I have added header images to my infoboxes using the stylesheet. How can I make sure that these images have a link to the appropriate page. For example the shopping cart info box has the following code (shopping_cart.php) : <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART); new shoppingcartboxheader($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART)); etc etc etc. You can see that I have used a custom style in the stylesheet named "shoppingcartboxheader". Here is my css code for "shoppingcartboxheader".: TD.shoppingcartboxheader { background: #FFFFFF; background-image: url('images/shoppingcartheaderpic.gif'); background-repeat:no-repeat; So where do I add the link to ensure that when the picture is clicked - they go to the shopping cart page? Thanks in advance. Jonathan Link to comment Share on other sites More sharing options...
spax Posted June 18, 2007 Share Posted June 18, 2007 You can't link the background image, you need it to display as a normal image to do that. That is why there is a little arrow on the headings that are linked. If you have text on top of the background image, you could use that to link. Something like this in shopping_cart.php for instance: <?php $info_box_contents = array(); $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . BOX_HEADING_SHOPPING_CART . '</a>'); new shoppingcartboxheader($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART)); Link to comment Share on other sites More sharing options...
jousley Posted June 21, 2007 Author Share Posted June 21, 2007 You can't link the background image, you need it to display as a normal image to do that. That is why there is a little arrow on the headings that are linked. If you have text on top of the background image, you could use that to link. Something like this in shopping_cart.php for instance: <?php $info_box_contents = array(); $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . BOX_HEADING_SHOPPING_CART . '</a>'); new shoppingcartboxheader($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART)); I did as you said and it seemed to work perfectly. the link is fine. However, now I have a border around my image. How can I get rid of this border? Thanks Jonathan Link to comment Share on other sites More sharing options...
spax Posted June 21, 2007 Share Posted June 21, 2007 If you used the tep_image() function, you wouldn't have a border. However, you can add this to your stylesheet to remove it: img { border: none; } Link to comment Share on other sites More sharing options...
jousley Posted June 21, 2007 Author Share Posted June 21, 2007 If you used the tep_image() function, you wouldn't have a border. However, you can add this to your stylesheet to remove it: img { border: none; } yes that worked perfectly. Thanks very much for your help Jonathan Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.