Hi, I am trying to make an image a clickable link, but when I added the code in bold, it made all the div's contents a link to the URL, not just the image. Has anyone any ideas on this? I'm kinda confused as to why this is happening. Many thanks or nay help, it's really appreciated.
You did not close the <a> tag. You must add </a> after the image. It seems like you are using XHTML standards in your code. Just so you know, target="_blank" is not valid XHTML, as that was removed in the HTML to XHTML transition. (If you are not using the XHTML strict doctype, then you can ignore this)
Wow, I go back to client server for a few years and when I come back to the web they don't allow _blank. Thanks for the heads up... gotta keep reviewing these standards.
Yes, since XHTML (strict) does not support the target="_blank" attribute for links, websites have moved toward using rel="external". XHTML does not have many restriction on the use of 'rel' which is supposed to define the relationship that link has to the current page. 'rel' is allowed to hold any value(s), including "external". To get your browser to open a link in a new window, you must use Javascript. Using Javascript, you can set all links that have rel="external" to open in a new window.