In Markdown, links are created by specifying three things, link text, URL and title text. The reason for doing this is that in HTML, you define these three things while adding links to web pages.
[link text](URL 'title text') OR [link text](URL "title text")
Note: HTML provides <a>
element to add links to web pages. The <a>
tag has two attributes, href
and title
. You specify URL using href
attribute.
The title text is provided using the title
attribute. It is displayed when someone hovers the link.
Format | Code or Output |
---|---|
Markdown | [Markdown tutorial](https://www.tutorialsandyou.com/markdown/ 'Learn Markdown') |
HTML Output | <a href="https://www.tutorialsandyou.com/markdown/" title="Learn Markdown">Markdown tutorial</a> |
Rendered Output | Markdown tutorial |
To add a reference link, you have to do three things:
Note: If you want to create footnotes, visit Markdown footnotes.
[link text][number] . . . [number]: URL 'title text'
Format | Code or Output |
---|---|
Markdown |
[Markdown tutorial][1] . . . [1]: https://www.tutorialsandyou.com/markdown/ 'Learn Markdown' |
HTML Output | <a href="https://www.tutorialsandyou.com/markdown/" title="Learn Markdown">Markdown tutorial</a> |
Rendered Output | Markdown tutorial |