当前位置:网站首页>Markdown 技能树(4):链接
Markdown 技能树(4):链接
2022-06-29 06:38:00 【programmer_ada】
Markdown 技能树(4):链接
Markdown 支持两种形式的链接语法:行内和参考两种形式。不管是哪一种,链接的文字都是用 [方括号] 来标记。
行内形式链接
行内形式的链接是在方块括号后面接括号并插入网址链接即可,如果你还想要加上链接的 alt 提示文字,只要在网址后面,用双引号把 alt 文字包起来即可,其格式为 [内容](http_url "alt 提示"),例如:
[ CODE CHINA ](https://codechina.csdn.net/)
[ 学习广场 ](https://codechina.csdn.net/courses "CODE CHINA 学习广场")
会产生:
<p><a href="https://codechina.csdn.net/" target="_blank"> CODE CHINA </a></p>
<p><a href="https://codechina.csdn.net/courses" title="CODE CHINA 学习广场" target="_blank"> 学习广场 </a></p>
参考形式链接
参考形式的链接使用另外一个方括号接在链接文字的括号后面,而在第二个方括号里面要填入用以辨识链接的标签:
[CODE CHINA] 1能够结合云原生技术为 开源技术的教学、学习提供一站式学习、练习的引擎,通过教学培训场景
[CODE CHINA][1]能够结合云原生技术为 开源技术的教学、学习提供一站式学习、练习的引擎,通过教学培训场景
也可以选择性地在两个方括号中间加上空白:
[CODE CHINA] [1]能够结合云原生技术为 开源技术的教学、学习提供一站式学习、练习的引擎,通过教学培训场景
接着,在文档的任意处,可以把这个标签的链接内容按照格式填写好,其格式为[id]: http://example.com/ "Optional Title Here":
[1]: https://codechina.csdn.net/courses?utm_source=explore "CODE CHINA 学习广场"
链接网址也可以用方括号包起来:
[1]: <https://codechina.csdn.net/courses?utm_source=explore> "CODE CHINA 学习广场"
你也可以把 alt 属性放到下一行,也可以加一些缩排,网址太长的话,这样会比较好看:
[1]: https://codechina.csdn.net/courses?utm_source=explore
"CODE CHINA 学习广场"
网址定义只有在产生链接的时候用到,并不会直接出现在文档之中。
链接辨识标签可以有字母、数字、空白和标点符号,但是并不区分大小写,因此下面两个链接是一样的:
[link text][a]
[link text][A]
默认的链接标签功能让你可以省略指定链接标签,这种情形下,链接标签和链接文字会视为相同,要用默认链接标签只要在链接文字后面加上一个空的方括号,如果要让 “Google” 链接到 google.com,可以简化成:
[Google][]
[Google]: http://google.com/
链接的定义可以放在文档中的任何一个地方,建议直接放在链接出现段落的后面,也可以把它放在文档最后面。
使用 Markdown 的参考式链接,可以让文档更像是浏览器最后产生的结果,把一些标记相关的信息移到段落文字之外,这样即使增加链接,Markdown 文档的阅读感也不会被打断。
小结
让我们来回顾一下链接的知识点吧:
- 可以使用
[内容](http_url "alt 提示")的形式添加一个链接 - 可以使用 参考样式 的方式添加一个链接,其结构为
[内容][1]+[1]: http_url "alt 提示"的组合
边栏推荐
- VerilogA - dynamic comparator
- To: Hou Hong: the key to enterprise digital transformation is not technology, but strategy
- 【翻译】Bink如何为英国一些最大的银行的数字忠诚度交易提供动力
- idea控台中文乱码问题【亲测有效】
- Redis (V) of NoSQL database: redis_ Jedis_ test
- 2022.6.27-----leetcode.522
- QT qframe details
- Unexpected exception ... code: Badrequest when downloading Xilinx 2018.2
- Uniapp obtains the date implementation of the beginning and end of the previous month and the next month
- QT program packaging and publishing windeployqt tool
猜你喜欢

Analytic hierarchy process

package. Are you familiar with all configuration items and their usage of JSON

How to do the performance pressure test of "Health Code"

你真的懂 “Binder 一次拷贝吗“?

Redis (4) of NoSQL database: redis new data type

Differences between JSON objects and JSON strings

国内代码托管中心- 码云
![[C language] flexible array](/img/22/3255740602232abfdf69624762adca.jpg)
[C language] flexible array

Open source 23 things shardingsphere and database mesh have to say

Uniapp obtains the date implementation of the beginning and end of the previous month and the next month
随机推荐
The meaning and calculation method of receptive field
LeetCode_动态规划_中等_91. 解码方法
IDEA常用插件
package. Are you familiar with all configuration items and their usage of JSON
Json tobean
Uniapp obtains the date implementation of the beginning and end of the previous month and the next month
施工企业选择智慧工地的有效方法
QT custom bit operation class
Ci tool Jenkins II: build a simple CI project
Li Kou daily question - day 30 -1281 Difference of sum of bit product of integer
Differences between JSON objects and JSON strings
你真的懂 “Binder 一次拷贝吗“?
Database - Synonyms
Datatables屏蔽报错弹窗
把多个ROC曲线画在一张图上
When the soft keyboard appears, it makes my EditText field lose focus
. NETCORE uses redis to limit the number of interface accesses
What are the conditions for a high-quality public chain?
JDBC connects to the database and socket sends the client.
IDEA 集成 码云