[MarkDown] How does CSDN's MarkDown editor jump to a specified position in the page

1. Grammar

1. Set the id through the span or a tag, and add an anchor point where you need to jump

<span id="mycode">跳转到的地方</span>

2. Use the following syntax to specify the anchor point to jump when you click [] in the article

[点击跳转](#mycode)

Note: [] is the text displayed by the button to be filled in, and the id value is followed by # in the parentheses. Because the jump is based on the id.

2. Example

  • Jump to the bottom
  • Jump to the middle
    ----------------------------- top ---------------- -------------------
    -----------------------------I am Dividing line-----------------------------------
    ------------- ----------------I am the dividing line------------------------------ -----
    -----------------------------I am the dividing line------------ -----------------------
    --------------------------- --I am the dividing line-----------------------------------
    --------- --------------------I am the dividing line-------------------------- ---------
    -----------------------------I am the dividing line-------- ---------------------------
    ----------------------- ------I am the dividing line-----------------------------------
    ----- ------------------------I am the dividing line---------------------- -------------
    -----------------------------I am the dividing line ----------------- ------------------
    -----------------------------I am split Line-----------------------------------
    -------------- ---------------I am the dividing line------------------------------- ----
    -----------------------------I am the dividing line------------- ----------------------
    ---------------------------- - middle -----------------------------------
    ------------- ----------------I am the dividing line------------------------------ -----
    -----------------------------I am the dividing line------------ -----------------------
    --------------------------- --I am the dividing line-----------------------------------
    --------- --------------------I am the dividing line-------------------------- ---------
    -----------------------------I am the dividing line-------- ---------------------------
    -----------------------------I am the dividing line ----------------- ------------------
    -----------------------------I am split Line-----------------------------------
    -------------- ---------------I am the dividing line------------------------------- ----
    -----------------------------I am the dividing line------------- ----------------------
    ---------------------------- -I am the dividing line-----------------------------------
    ---------- -------------------I am the dividing line--------------------------- --------
    -----------------------------I am the dividing line --------- --------------------------
    ------------------------ -----I am the dividing line-----------------------------------
    ------ ----------------------- Bottom -------------------------- ---------
  • Jump to the top
  • Jump to the middle

3. Sample code

If you are not sure, just copy the code below and run it on the CSDN markdown editor.

- [跳转到底部](#bottom)
- [跳转到中间](#center)
-----------------------------<span id="top">顶部</span>-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------<span id="center">中间</span>-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
-----------------------------我是分割线-----------------------------------
----------------------------- <span id="bottom">底部</span>-----------------------------------
- [跳转到顶部](#top)
- [跳转到中间](#center)

Guess you like

Origin blog.csdn.net/qq877728715/article/details/115350161