How to open markdown link in new tab

featured Image

In this short post, find out how to open a markdown link in a new tab.

When using markdown to create your blog or any web page using a markdown parser we might want to open the link in our webpage in a new tab.

In markdown, we can create a link using the markdown syntax like this

[Link to google](https://google.com)

This will create <a> tag link in our parsed HTML output link this

<a href="https://google.com" >Link to google</a>

When we click this link, it will open google in the same tab.

So how can we open the link in a new tab in markdown ?

To open a link in a new tab in our browser is very simple, we just have to use the target attribute in our <a> tag.

Even though there is no native way to add any attributes in our markdown syntax, markdown allows us to use plain HTML tags whenever needed.

So, we can use write the <a> in our markdown document and set target='_blank' attribute.

<a href="https://google.com" target="_blank">Link to google</a>

This code will create the link in our webpage which when clicked will open the link in a new tab in our browser.


Related Articles:

How to write superscript and subscript in markdown

How to center align an image in markdown

How to do text highlight in markdown

How to underline in markdown

How to change image size in markdown in GitHub

How to make horizontal line in markdown

How to write comments in a Markdown File

Easy Way to add Emoji in markdown with VS Code

Related Posts

git commands with example

Top 40 Git commands with Examples

GitHub has become an essential tool for developers to manage, store, and collaborate with other developers on software projects. With its simple powerful git-based version control system, GitHub allows users…

Read more
Check GitHub Account in the Terminal

Check GitHub Account in the Terminal

GitHub is an integral tool for developers to store, manage, and collaborate on software projects with other developers. And as we work more and more in the command line it…

Read more
featured Image

How to make list of objects in Netlify CMS using list and object Widget

Here in this Netlify CMS tutorial we will how easily we can make a list of objects using list and object widgets. This will allow us to add multiple objects…

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *