[CSDN_Markdown] Markdown syntax 2: markdown syntax

Source: Internet
Author: User

[CSDN_Markdown] Markdown syntax 2: markdown syntax
Introduction

In the previous article, the basic syntax of Markdown is introduced in the basic syntax of Markdown. Knowing the basic syntax, you can actually write a pure text blog. For those of us who write code or who are about to write code, it seems that this is not enough. We also hope to insert images, code, tables, and hyperlinks! This article describes how to use these features in Markdown.

Table

See the following table:

Name Age Education level
Zhang San 16 High School
Li Si 17 University
Wang Wu 18 Graduate Student


The Markdown text is:

| Name | age | Education |: ---: | Zhang San | 16 | high school | Li Si | 17 | University | Wang Wu | 18 | graduate student |

From the above example, we can see that the table generated by Markdown uses the colon to select the left:---, Right---:Or Center:---:Alignment. The number of short lines in the second line of the code can be determined based on the appearance.

Code

For example, insert the following code:

#include <iostream>using namespace std;int main(){  cout << "hello markdown" << endl;  return 0;}

You can enter the following content in the Markdown Editor:

The syntax rules are as follows:

Use three backticks (') in the first and last lines of the code block to be highlighted, and use the language of the surface code block after the first line of backticks.

The code in the row can be enclosed by two backquotes, for exampleprintf()It is obtained by inputting 'printf.

Insert Image Insert an image in plain text format

For example:

![hust](http://www.bkjia.com/uploads/allimg/150313/0T93W4O-0.gif)

The result is:

Syntax:

Exclamation point! Followed by a square brackets []. You can add instructions to brackets, followed by parentheses (). Enter the URL of the inserted image in parentheses.

Use the CSDN Markdown editor to insert

You can also select the insert image button in the toolbar of the CSDN Markdown Editor:

Select Upload Image

After selecting the image, upload the point set, and then click OK ~~

Hyperlink

You can add hyperlinks directly in the text.

Parentheses are followed by parentheses, and the text of the prompt is added to the brackets. The parentheses contain hyperlinks.

For example

[Bendanban blog] (http://blog.csdn.net/bendanban)

The result is:

Bendanban's blog

You can also use a format similar to the one referenced in the paper.

Use two adjacent brackets in the body. Add prompt text to the first brackets, and add an id to the second brackets to enable numbers and letters.
Add a reference-like format at the end of the text: A brackets followed by a colon, and then connect to the address. Enter the id in the first brackets.

For example:

[Prompt text] [1] [1]: http://blog.csdn.net/bendanban

The result is:

Prompt text

You can also include the hyperlink directly with two angle brackets in the body.

For example:

The result is:

Http://blog.csdn.net/bendanban or sawpara@126.com

Summary

This article describes how to enrich your blog with tables, code, images, and hyperlinks in Markdown. A table is a combination of a vertical line and a colon. The Code contains three quotation marks or one. The picture uses exclamation marks, brackets, and parentheses. The hyperlink uses brackets, Parentheses, and angle brackets.

PS: Thank you for your criticism!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.