Markdown Links
Creating hyperlinks is one of the most common tasks in web writing. In Markdown, links (which correspond to the HTML a tag) can be created in a few different ways.
Inline Links
To create an inline link, wrap the link text in brackets (e.g., [Quackit]) and then wrap the URL in parentheses (e.g., (https://www.quackit.com)).
Links with Titles
You can also add a title for the link. This will appear as a tooltip when a user hovers over the link. To add a title, place it in quotation marks after the URL inside the parentheses.
Reference-Style Links
Reference-style links are a special kind of link that make URLs easier to manage and keep your Markdown source code cleaner. This is especially useful for long documents where the same URL might be used multiple times.
Reference-style links use a second set of brackets for a label, which matches a definition you provide elsewhere in your document (usually at the very bottom).
Formatting Links
You can emphasize the text of a link by adding asterisks or underscores around the brackets.
Tips & Best Practices
- URLs with Spaces: If a URL contains spaces, replace them with
%20. - Internal vs External: You can link to absolute URLs (like
https://...) or relative paths (like../index.cfm). See the HTML Links lesson in the HTML tutorial for more information about link types. - Readability: Use reference-style links if your document has many links. It keeps the text much more readable during the editing process.