Links are called hyper or anchor links on web pages.
anchor links on a web page allow you to link to content on the same page or a different page.
These support navigating to different sections/URLs of web resources.
Here is an example of writing anchor links using an HTML tag
Mainly, It contains two parts - the first is the page name url, and the second name is the display text.
Markdown syntax links
Links creates with the below syntax in markdown.
Link text wrapped in square brackets() followed by link URL with parenthesis.
Many types of links can create in Markdown.
- Inline Links
- Relative Links
- mailto Links
- Reference Links
Inline or External Links in markdown
External links are links pointing to an external domain.
Inline links contain text displayed to the user enclosed in square brackets
and link URL enclosed in parenthesis
Links Url is an absolute URL like domainname. extension.
[links text](Links Url)
Generated HTML is
<a href="#">links text</a>
And the output is [links text](#)
Relative Links in markdown
relative links are used for links within the same domain.
For example, relative URLs are /about
It contains without HTTP and website.com/about
[links text](relative Url)
Generated HTML is
<a href="/about">About Us</a>
How to add a link part of the same document in markdown.
Sometimes we want to navigate sections or parts of a document on the same webpage.
[go to heading](#heading)
On the webpage, You will have
<a name="heading"> My Heading </a>
mailto links in markdown
mailto links are used to include a link with an email address.
to add email address links with markdown markup,
mailto with colon and email address
[Contact Us](mailto:[email protected])
It link defines the link text with names. These names are referenced and mapped with the URL
It is reference links [emphasis tutorials][myexample] [myexample]: /file/markdown-emphasis "markdown emphasis tutorials"
It is reference links emphasis tutorials
Links with title
markup can also contain links with title text Add title text enclosed in double quotes in parents including link URL
Links title example [example link](URL "link title text")
Output Links title example example link
Create a link with a target blank in the markdown
There is no way to open a new window with standard markdown syntax.
You can use a simple anchor tag like this below
<a href="url" target="_blank">link</a>
Some implementations like kramdown use the below syntax