Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make hyperlinks open in a new tab using CSS or Multimarkdown?

I am using Text::MultiMarkdown to create HTML files from MultiMarkdown documents.

I would like all links to open in a new tab.

Is there a way to configure this behavior using a CSS template, or directly in the MultiMarkdown document (without explicitly writing HTML around each link in the MultiMarkdown document)?

like image 570
David B Avatar asked Nov 26 '10 16:11

David B


People also ask

How do you make a link open in a new tab CSS?

The short answer is: just add a target="_blank" attribute to your links (anchor tags). Now when your visitors click that link, it will open in a new window or tab (depending on which web browser they are using and how they configured that browser).

How can you open an URL into a new tab when clicked?

Hold down the Ctrl key and click the link. Use the wheel button of your mouse to click the link. Right-click the link and then click Open link in new tab.

How can I have Chrome automatically open a new tab when I click on a link?

Use Mouse or Trackpad Only If you use a mouse, simply utilizing the middle mouse button to click on a link will immediately open it in a new browser tab! Holding down the Shift key while middle-clicking also helps you switch to the tab automatically. Trackpads on Windows laptops can also open links in new tabs.


1 Answers

Definitely not in CSS - that is only concerned with the way the elements appear, not how they behave.

It should be possible to add <base target="_blank"> to the head of the HTML document (using XSLT), but that's on par with adding it to each link.

like image 177
Piskvor left the building Avatar answered Sep 17 '22 15:09

Piskvor left the building