0

In Mi Yodeya, how can I make the link in my question/answer open in a new tab/window when clicked on?

In other words, how can I set up my posts so that when other users click on the links, they will be automatically transferred to another tab/page?

| |
  • as a coding question when embedding a link? – rosends Jan 1 '15 at 21:06
5

You clarified in a comment that you "wanted to ask how to make it do it even when clicked on with a usual click" -- that is, you're asking not how the viewer can control this but how you can cause it at the source.

In the Markdown that Stack Exchange uses, you can't. That's a special HTML directive and posts aren't written (directly) in HTML.

I would also argue that even if you could, you shouldn't. There have been many published studies about why this is bad user experience. If you control it at the source you are taking the decision away from the user, who no longer has the option to browse the way he wants to. If you leave it alone, the user -- by using a different mouse gesture -- can open it in a new tab if he wants to.

Anecdotally, I've used web sites that litter my browser with tons of new tabs, making a mess for me to clean up later. And if I don't notice that's what it's doing, I'm confused about why my back button isn't working. It's disorienting. Please don't do it.

| |
  • "In the Markdown that Stack Exchange uses, you can't. That's a special HTML directive and posts aren't written (directly) in HTML." Well... sort of. You can use the a element, but not with the target attribute which specifies the window to open in. It's not so much "not HTML" as "modified HTML". – msh210 Jan 1 '15 at 22:45
  • @msh210 oh, thanks -- I didn't know that. – Monica Cellio Jan 1 '15 at 22:49
1

use the middle button on your mouse when clicking on the link.

In the unlikely event that you don't have a middle button, right click, and select the option to 'Open Link in a New Tab'

| |
  • i am sorry, i wanted to ask how to make it do it even when clicked on with a usual click – hazoriz Jan 1 '15 at 20:56
0

The way I do it is press the ctrl key while clicking on a link.

This works on MY, as well as for any links you'll find in your browser.

If you'd like to automatically switch to the new tab when it opens, press shift at the same time.

You can also right-click on the link, and select "open in new tab" and "open in new window" from the drop-down menu.

| |
  • Unless, of course, you set it to automatically open in a new tab, in which case reverse the <shift> clause. – Scimonster Jan 1 '15 at 21:17
  • Also true. I assume that someone who would ask this kind of question is not advanced enough to know how to change that setting. As it is, I think I misunderstood the question, as per Monica's answer – MTL Jan 1 '15 at 21:18

You must log in to answer this question.

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