Hello guys,
I've been working on a page where there are several entries contained in different <div>
s. Each is only a title linked to a page, an image and a short description. However, the description may contain arbitrary tags, including <a>
tags.
Since these are pretty straightforward and the actual link isn't that big, I've made it so a click on the <div>
will call location.href = (link URL)
. However, that's a pretty sad thing, because it's browser-unfriendly: for instance, under Google Chrome, a middle-click on one of said <div>
s won't open the link in a new tab.
Considering you shouldn't nest <a>
tags, is it possible to make any element in XHTML behave like a link without resorting to Javascript?
I'm using XHTML 1.1, sent with the proper MIME type, and that's the only restriction I'm bound to.