Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

a href link on img

Hi I have the following code to have few links on top of img. It works well in FF but not in IE. It seems IE is not clickable if you put link on top of img

<div style="z-index:-6755;"><img alt="October Offer" src="images/offers/october-offer.jpg" /></div>
<a href="javascript:void(0);" onclick="window.parent.SqueezeBox.close();" style="text-decoration: none; width: 147px; height: 32px; position: inherit; bottom: 32px; left: 50px; border: 1px solid red; display: block;" target="_parent"> </a> 

<a href="#" onclick="window.parent.SqueezeBox.close();">
<div style="display:block; width: 185px; height: 32px; position: relative; bottom: 50px; left: 260px;border:1px solid blue; ">&nbsp;</div>
</a>
like image 256
redcoder Avatar asked Sep 23 '10 15:09

redcoder


People also ask

How do I add a hyperlink to an image?

Adding Hyperlinks to Images in Word This is an easy three-step process: Insert the image into the document. Right-click the image and select "Link" from the drop-down menu. Type or paste the hyperlink address into the "Address" field.

What is HREF in image?

href attribute sets the URL to link to. <img> is the image start tag. src attribute sets the image file. title attribute sets the image tooltip text. alt is the image tag alt text attribute.

How do I add a link under the image in HTML?

First, the paragraph element (<p> tag) contains the image and hyperlink. Next, the <a> tag is the hyperlink that is pointing to the Computer Hope website. Next, the third line contains the <img> tag that is used to show the image. The src attribute tells the browser where the image is located.

How do I associate an image with a link?

Copy the URL you want to link to your image. Drag-and-drop the image that you want to turn into a link into your template. Click the image to open the toolbar, then click the link icon and select "Web Page" from the drop-down. Paste the copied URL into the Link URL Field.


1 Answers

are you just trying to make the image clickable?

you can't have <href> that's not a correct html tag.

either place <img> inside <a> like so: <a href="http://www.example.com/"><img /></a>

another way is to set a div with a background image of your image and then a link inside there, make the link display : block and make it the entire width and height of the div and the whole thing will be clickable.

like image 83
Alex B Avatar answered Oct 11 '22 11:10

Alex B