When I use middle click or Ctrl+Click on the Visit Meta link on a Stack Exchange 2.0* site it opens the meta site in the new window and the current window.

This is irritating - can it be fixed please?

Note: It works fine for the meta link in the toolbar but not for the link in the right hand pane.

*Specifically on WebApps & Programmers

2 Answers 2


A fix is on the way. We'll sprite the anchors instead of the H4s. This way we'll get rid of the onclick event on H4s and still have a visible and clickable area. Also in the future, we may look into changing the doctype to html5, where <a> around block level elements are allowed.


This is because HTML 4.01 strict doesn't allow a hyperlink outside a <div>, eg, this is invalid markup (but works in every browser just fine..)

<a href="">

Putting the link inside the div doesn't work with CSS spriting, and leads to awkward styling problems.

Thus we are forced to use a div with an onclick action instead.

<div onclick="window.location.href=''">

(similar issue on the homepage and a few other places, anywhere you want an entire div to be a hyperlink..)

  • Why do you want the entire div of "Visit Meta" to be a hyperlink?
    – kennytm
    Dec 20, 2010 at 8:33
  • @kennytm take a look at any se 2.0 site with the sketchy theme, fex diy.stackexchange.com Dec 20, 2010 at 8:36
  • @Jeff: But WebApps and Programmers do not use Sketchy anymore.
    – kennytm
    Dec 20, 2010 at 8:43
  • @Jeff - the onclick event isn't attached to a div it is attached to h4 with a hyperlink inside e.g <h4><a ...> </a></h4> removing the onclick event from the heading makes no difference to styling and the hyperlink works as expected? Dec 20, 2010 at 8:45
  • @barry sorry for the confusion, I wasn't clear above, this is a related but slightly different issue. The sprited sites move the 'inside' hyperlink away somewhere off in hyperspace (for css spriting) so it cannot be clicked on. The outer container MUST carry the link. Normally I'd say "no problem just wrap the <div> or <h4> in a hyperlink!" but.. no valid 4.01 strict. Dec 20, 2010 at 8:50
  • @Jeff - I see now - this makes sense. However as @KennyTM pointed out WebApps & Programmers don't use the sketchy theme any more :) Also, could you not use this technique explained here by createErrorMsg. I tried it locally on a quick demo page and it appears to work fine. But I obviously don't have the entire CSS so I don't know what it might affect elsewhere. Dec 20, 2010 at 9:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .