Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Markdown Links

Markdown Links

Links are the key elements that make Markdown documents interactive.

Mastering link syntax lets you create content-rich, easy-to-navigate documents.

The link usage method is as follows:



[链接名称](链接地址)

[链接文字](链接地址 "可选的标题")

Or:



<链接地址>

A simple link:

这是一个链接 [Runoob Tutorial](https://www.runoob.com)

The display result is as follows:

Use the link address directly:



The display result is as follows:

Set an optional title:

这是一个链接 [Runoob Tutorial](https://www.runoob.com)

欢迎访问 [GitHub](https://github.com) 官网

这是 [百度搜索](https://www.baidu.com "百度一下,你就知道")

The display result is as follows:

** The role of the link title: **

Email links:

markdown联系我:[发送邮件](mailto:example@email.com)

电话联系:[拨打电话](tel:+86-138-0013-8000)

Reference Links

Reference-style links separate the link definition from its use, making the document cleaner — especially suitable for long documents or cases that reference the same link multiple times.

Basic syntax:

markdown[链接文字][参考标签]



[参考标签]: URL "可选标题"

We can set a link via a variable, with the variable assignment done at the end of the document:



这个链接用 1 作为网址变量 [Google][1]

这个链接用 runoob 作为网址变量 [Runoob][runoob]

然后在文档的结尾为变量赋值(网址)



  [1]: http://www.google.com/

  [runoob]: http://www.runoob.com/

The display result is as follows:

Simplified form:

When the reference label is the same as the link text, the second pair of brackets can be omitted:



markdown 我喜欢使用 [GitHub][] 来管理代码。



[GitHub]: https://github.com

Advantages of reference links:

Organization tips:

markdown# 学习资源推荐



## Online Tutorial

- [MDN Web Docs][mdn] - 权威的 Web 技术文档

- [RUNOOB][rnb] - 适合初学者的教程网站

- [freeCodeCamp][fcc] - 免费的编程学习平台



## 代码托管

- [GitHub][github] - 最受欢迎的代码托管服务

- [GitLab][gitlab] - 企业级的代码管理平台





[mdn]: https://developer.mozilla.org/

[rnb]: https://www.runoob.com/

[fcc]: https://www.freecodecamp.org/

[github]: https://github.com/

[gitlab]: https://gitlab.com/

Automatic link recognition

Modern Markdown parsers usually support automatic recognition of URLs and email addresses:

URL auto-recognition:



markdown直接输入网址:https://www.example.com

用尖括号包围:

Email auto-recognition:



markdown联系邮箱:example@email.com

或者:

** Notes: **

Using anchor links

Anchor links are used to jump within the same document, especially suitable for navigating long documents:

Jump to a heading:

## 目录

- [第一章:介绍](#第一章介绍)

- [第二章:安装](#第二章安装)

- [第三章:使用方法](#第三章使用方法)



# Chapter 1: Introduction

这里是介绍内容...



# Chapter 2: Installation

这里是安装说明...



# Chapter 3: Usage

这里是使用说明...

Anchor rules:

** Create anchors manually: **



## Custom anchor position



[跳转到自定义位置](#custom-anchor)

Return link at the top of the page:



[回到顶部](#)