How to open markdown link in new tab
Article on how to open a markdown link in a new tab in browser using target="_blank" in the ahref link.
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 Posts
Checkbox inside GitHub Markdown Table
Short article on how to create checkbox or tick and cross mark inside markdown table in Github using emoji.
How to convert markdown to PDF offline with Pandoc Converter
Find out how to convert or merge two or more markdown files into a pdf format in windows and MacOs using command line in Pandoc document converter.
Easy Way to add Emoji in markdown with VS Code
Find out how to add emoji in your markdown document in VS Code using markdown emoji or emojisense plugins.
How to change image size in markdown in GitHub
Find out different ways on how to change or resize image size in markdown for GitHub profile. Learn to change markdown image size using CSS style.
