Markdown入门指南_html/css_WEB-ITnose
What?
Markdown是一种轻量级的 「标记语言」,它的优点很多,目前也被越来越多的写作爱好者,撰稿者广泛使用。看到这里请不要被「标记」、「语言」所迷惑, Markdown的语法十分简单。常用的标记符号也不超过十个,这种相对于更为复杂的 HTML标记语言来说, Markdown是十分轻量的,学习成本也不需要太多,且一旦熟悉这种语法规则,会有一劳永逸的效果。
Why?
既然这种标记语言最终还要转换为 HTML文档格式,那么为什么我们还要使用它呢?有啥好处?
- 专注于你写作的内容本身,而不是排版样式。
- 可以导出 HTML、PDF 和本身的 .md 文件。
- 纯文本内容,兼容所有的文本编辑器与字处理软件。
- 随时修改你的文章版本,不必像字处理软件生成若干文件版本导致混乱。
- 可读、直观、学习成本低。
How?
基本技巧
标题
文章内容较多时,可以用标题分段:效果:
标题1
标题2
标题3
标题4
标题5
标题6语法:
# 标题1## 标题2### 标题3#### 标题4##### 标题5###### 标题6
粗体和斜体
效果:
斜体文本
粗体文本
粗斜体文本
语法:
*斜体文本* 或者 _斜体文本_**粗体文本** 或者 __粗体文本__***粗斜体文本*** 或者 ___粗斜体文本___
链接
常用链接方法
效果:
文字链接 Reeoo’s Blog
网址链接 http://reeoo.me
语法:
文字链接 [链接名称](http://链接网址)网址链接 <http://链接网址>
高级链接技巧
这个链接用 me作为网址变量 [ReeooMe][me]
这个链接用 co作为网址变量 [ReeooCo][co]
然后在文档的结尾为变量赋值(网址)
[me]: http://reeoo.me/[co]: http://reeoo.co/
效果:
ReeooMe
ReeooCo列表
普通无序列表效果:
- 列表项1
- 列表项2
- 列表项3语法:
- 列表文本前使用 [减号+空格]+ 列表文本前使用 [加号+空格]* 列表文本前使用 [星号+空格]
Copy after login
普通有序列表效果:
- 列表前使用 [数字+空格]
- 我们会自动帮你添加数字
- 不用担心数字不对,显示的时候我们会自动把这行的 7 纠正为 3
语法:
1. 列表前使用 [数字+空格]2. 我们会自动帮你添加数字7. 不用担心数字不对,显示的时候我们会自动把这行的 7 纠正为 3
引用
普通引用
> 引用文本前使用 [大于号+空格]> 折行可以不加,新起一行都要加上哦
效果:
引用文本前使用 [大于号+空格]折行可以不加,新起一行都要加上哦
引用里嵌套引用
语法:
> 最外层引用> > 多一个 > 嵌套一层引用> > > 可以嵌套很多层
效果:
最外层引用
多一个 > 嵌套一层引用
可以嵌套很多层
引用里嵌套列表
语法:
> - 这是引用里嵌套的一个列表> - 还可以有子列表> * 子列表需要从 - 之后延后四个空格开始
效果:
- 这是引用里嵌套的一个列表
- 还可以有子列表
- 子列表需要从 - 之后延后四个空格开始
图片
跟链接的方法区别在于前面加了个感叹号 !,这样是不是觉得好记多了呢?
语法: 当然,你也可以像网址那样对图片网址使用变量
这个链接用 me作为网址变量 [Reeoo's Blog][me].
然后在文档的结尾位变量赋值(网址)
[me]: http://img.reeoo.me/compass/add.jpg
分隔符
如果你有写分割线的习惯,可以新起一行输入三个减号-。当前后都有段落时,请空出一行:
写法:
前面的段落---后面的段落
效果:前面的段落
后面的段落
表格
表格是我觉得 Markdown比较累人的地方,例子如下:
| 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 |
代码
如果你只想高亮语句中的某个函数名或关键字,可以使用 `function_name()` 实现( function_name())
通常编辑器根据代码片段适配合适的高亮方法,但你也可以用 ``` 包裹一段代码,并指定一种语言
$(function () { console.log('reeoo.me');});
支持的语言: actionscript, apache, bash, clojure, cmake, coffeescript, cpp, cs, css, d, delphi, django, erlang, go, haskell, html, http, ini, java, javascript, json, lisp, lua, markdown, matlab, nginx, objectivec, perl, php, python, r, ruby, scala, smalltalk, sql, tex, vbscript, xml也可以使用 4 空格缩进,再贴上代码,实现相同的的效果
console.log('reeoo.me')
参考文献
- Markdown 编辑器语法指南
- Markdown——入门指南

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati
