文章详情 学习记录

Markdown学习

发布时间:2026-04-21 16:41 浏览次数:8 最后更新:2026-04-23 15:34

Typora的使用方法汇总

正文内容

标题

语法:

# (一级标题)
## (二级标题)
### (三级标题)

注意:#号键和文字之间有一个空格,否则无法生效。

快捷键:

  • Ctrl+数字1-6可以快速将选中的文本调整为对应级别的标题(数字为键盘上的横排数字)

  • Ctrl+0可以快速将选中的文本调整为普通文本

  • Ctrl+加号/减号可以对标题级别进行加减

段落

换行

语法:

大换行:使用回车键

小换行:使用Shift+回车键

区别:大换行实际上插入了两个换行符,其两行之间有一个空白行。小换行则表现为两行紧挨着,实际上只插入了一个换行符。

分割线

语法:三个减号或三个星号,然后按下回车键即可生成分割线

---
或者
***

效果:


文字

字体

语法

**这是粗体**
~~这是删除线~~
<u>这是下划线</u>
*这是斜体*
==这是高亮==

效果:

这是粗体

这是删除线

这是下划线

这是斜体

这是高亮

快捷键:

  • 加粗:Ctrl+B

  • 删除线:Shift+Alt+5

  • 下划线:Ctrl+U

  • 斜体:Ctrl+L

注意:这些符号可以随意组合形成多种样式。若需要输入这些符号则需要转义符:\,如*5*

上下标

语法:

x^2^
H~2~O

效果:

x2 H2O

颜色

语法:

#字体显示为蓝色
<font color="blue">test</font>
#字体显示为蓝色
<font color="#0000FF">test</font>


#背景显示为红色
<font style="background:red">test</font>
#背景显示为红色
<font style="background:#FF0000">test</font>
#背景显示为红色
<span style="background:#FF0000">test</span>
#背景显示为红色
<span style="background:#FF0000">test</span>

列表

无序列表

代码:

*或-或+ 加 空格
使用Tab键可以提升级数
使用Shift+Tab降低级数
连续降低级数可以使其变为普通文本

快捷键:Ctrl+Shift+]

有序列表

代码:

数字 加 . 加 空格
使用Tab键可以提升级数
使用Shift+Tab降低级数
连续降低级数可以使其变为普通文本

效果:

  1. 内容一

  2. 内容二

快捷键:Ctrl+Shift+[

任务列表

代码:

- [ ] 吃早餐
- [x] 背单词
Shift+Tab可以降低为普通文本

效果:

  • 吃早餐
  • 背单词

区块显示

代码:

>加 空格
Shift+Tab可以降低为普通文本

代码显示

行内代码

代码:

`int a=0;`
`号键在数字1键的旁边,ESC键的下方(英文格式下)

效果:

int a=0;

快捷键:Ctrl+Shift+`

代码块

代码:

```js/java/C#/text 加 回车
其中js/java/C#/text这些可写可不写
当写了代码类型时,编辑器可为其语言使用特定的颜色

如果要跳出代码块另起一行需使用 Ctrl+回车键 

如:

using test;
namespace testNamespace
{
    class testClass
    {
        private static Test()
        {
            int i=10;
            return;
        }
    }
}

快捷键:Ctrl+Shift+K

链接

代码:

www.baidu.com
显示为链接

[百度一下](https://www.baidu.com)
显示为文字链接

[百度一下](https://www.baidu.com "跳转https://www.baidu.com")
当鼠标置于文字上出现提示

[标题一](#一、标题)
注意:使用页内标题跳转时注意书写格式,#和文字之间不能有空格

使用Ctrl+鼠标左键点击链接可以直接跳转

效果:

www.baidu.com

百度一下

百度一下

标题一

快捷键:Ctrl+K

脚注

作用:对文本进行解释说明。

代码:

文本[^1]
[^1]:解释说明

当鼠标置于标注上会显示解释说明文本
使用Ctrl+鼠标左键点击可以在标注和解释之间跳转

若要将脚注解释说明文本换行,可以在换行处插入<br>标签
是否显性的显示<br>标签可以在设置里面更改

图片插入

代码:

![此处的任何文字都不会显示,可以用来做标注](图片路径 "图片标题")

效果: 小狗笑

表格

使用快捷键:Ctrl+T(表格代码很复杂,很难直接输入(可以在源代码中查看表格语法))

输入行数和列数后会生成一个表格

此时可以在表格中填写内容。

在表格中换行可以使用 Shift+回车键 来进行换行

自动生成大纲序号以及标题序号

在文件夹中创建base.user.css文件,在文件中输入如下代码即可:

/*文章标题自动编号*/
/** initialize css counter */
#write {
    counter-reset: h1
    }
    h1 {
    counter-reset: h2
    }
    h2 {
    counter-reset: h3
    }
    h3 {
    counter-reset: h4
    }
    h4 {
    counter-reset: h5
    }
    h5 {
    counter-reset: h6
    }
    /** put counter result into headings */
    #write h1:before {
    counter-increment: h1;
    content: counter(h1) ". "
    }
    #write h2:before {
    counter-increment: h2;
    content: counter(h1) "." counter(h2) " "
    }
    #write h3:before,
    h3.md-focus.md-heading:before /** override the default style for focused headings */ {
    counter-increment: h3;
    content: counter(h1) "." counter(h2) "." counter(h3) " "
    }
    #write h4:before,
    h4.md-focus.md-heading:before {
    counter-increment: h4;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) " "
    }
    #write h5:before,
    h5.md-focus.md-heading:before {
    counter-increment: h5;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " "
    }
    #write h6:before,
    h6.md-focus.md-heading:before {
    counter-increment: h6;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) " "
    }
    /** override the default style for focused headings */
    #write>h3.md-focus:before,
    #write>h4.md-focus:before,
    #write>h5.md-focus:before,
    #write>h6.md-focus:before,
    h3.md-focus:before,
    h4.md-focus:before,
    h5.md-focus:before,
    h6.md-focus:before {
    color: inherit;
    border: inherit;
    border-radius: inherit;
    position: inherit;
    left:initial;
    float: none;
    top:initial;
    font-size: inherit;
    padding-left: inherit;
    padding-right: inherit;
    vertical-align: inherit;
    font-weight: inherit;
    line-height: inherit;
    }

/*文章大纲自动编号*/
.sidebar-content {
    counter-reset: h1
}

.outline-h1 {
    counter-reset: h2
}
 
.outline-h2 {
    counter-reset: h3
}
 
.outline-h3 {
    counter-reset: h4
}
 
.outline-h4 {
    counter-reset: h5
}
 
.outline-h5 {
    counter-reset: h6
}


.outline-h1>.outline-item>.outline-label:before {
    counter-increment: h1;
    content: counter(h1) " "
}

.outline-h2>.outline-item>.outline-label:before {
    counter-increment: h2;
    content: counter(h1) "." counter(h2) " "
}
 
.outline-h3>.outline-item>.outline-label:before {
    counter-increment: h3;
    content: counter(h1) "." counter(h2) "." counter(h3) " "
}
 
.outline-h4>.outline-item>.outline-label:before {
    counter-increment: h4;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) " "
}
 
.outline-h5>.outline-item>.outline-label:before {
    counter-increment: h5;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " "
}
 
.outline-h6>.outline-item>.outline-label:before {
    counter-increment: h6;
    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) " "
}

正文内容已启用复制保护,代码块仍支持复制。

评论区

0 条已展示评论
发表评论

发表评论

提交后将进入人工审核,审核通过后才会展示。

邮箱仅用于必要的联系与基础风控,不会在页面中公开展示。

请文明发言,避免发布广告、链接或敏感内容;短时间内频繁提交会被限制。

隐私提示:提交评论即表示你同意站点为评论展示、审核、防刷与安全风控目的处理你填写的昵称、邮箱和评论内容。

其中邮箱不会公开展示,也不会用于与评论无关的公开用途。

已展示评论

读者留言

以下仅展示已通过审核的评论内容。

0 条评论
当前还没有通过审核的评论,后续可在后台审核后展示。