markdown的基本使用

445 阅读2分钟

markdown模式通常用于 代码的全篇注释,markdown文件的后缀名为.md , 现在来说说markdown的一些基本用法。 ##标题的大小

  • 标题大小只需要在文字钱加上 # 符号即可(注意空格) #的个数即为标题文字大小。例如:
最小标题 6个#字符,
最小标题 5个#字符,

最小标题 4个#字符,

###最小标题 3个#字符, ##最小标题 2个#字符, #最大标题 1个#字符,

无序列表(##)

  • 简书无序列表只需要在文字加上 - 即可实现
  • 我是无序列表1
  • 我是无序列表2

有序列表

  1. 我只需要在文字开始位置 输入序列号 1. 即可(注意空格)
  2. 我是有序列表2

##链接和图片 (提示 转义符号为" \")

引用 (提示 转义符号为" >")

-只需要在文字前加入 > 即可

白日依山尽 黄河入海流 欲穷千里目 更上一层楼

粗体 斜体

  • 斜体:只需要将文字用 * 符号包裹,粗体: 用 ** 包裹 我是用*包裹的斜体 我是用** 包裹的粗体

##表格

  • 在表头部分 表格默认左对齐 右对齐需要在单元格右边加 : ,居中对齐 则两端加入 : 即可 如图
 | Tables       | Are           | Cool  |
 | ------------- |:-------------:| -----:|
 | col 3 is      | right-aligned | $1600 |
 | col 2 is      | centered      |   $12 |
 | zebra stripes | are neat      |    $1 |
Tables Are Cool
col 3 is right-aligned $1600
col 2 is centered $12
zebra stripes are neat $1
col 2 is centered $12

##代码引用

  1. css的代码片段 markdown支持代码高亮显示

```css div{ color:red; } ```

  div{ color:red; }   

`` div{ color:red; }`` 的写法可以凸显代码样式 ,但是没有颜色区分,举个栗子,如下:

div{ color:red; }

  1. html的代码片段

```html <div style='color:red;'>这是编辑器写的一句话 ```

<div style='color:red;'>这是简书中编辑器写的一句话</div>
  1. javaScript代码片段

```javascript window.onload= function(){ alert(1); } ```

  window.onload= function(){
      alert(1);
}