DEV Community

Cover image for Linking Anchors In Standard MarkDown
Claudia Wu.
Claudia Wu.

Posted on

Linking Anchors In Standard MarkDown

Dev.to uses standard markdown. Define an anchor you want to link to right before the line you want to refer:

<a name="anchor-name-1"></a>

and place your link:

[link text](#anchor-name-1)

If you want to link to a remote url you can also do this:

[link text](https://[...]#anchor-name-1)

Try it yourself πŸ˜‰

[Try it yourself](#try-yourself) πŸ˜‰
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
<a name="try-yourself"></a>
# If you got here it worked! πŸ€ͺ
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

If you got here it worked! πŸ€ͺ

.
.
.
.
.
.
.
.
.
.
.
.

Any ideas or feedback?

I would like to know your thoughts and experience related to this topic.

Do you like this article? Follow me on Twitter and don’t miss any future posts.

Top comments (3)

Collapse
 
cescquintero profile image
Francisco Quintero πŸ‡¨πŸ‡΄

Another way is to use the header words separated by dashes:

# If you got here it worked

Can be anchored this way:

[Anchor link](#if-you-got-here-it-worked)

Although it's very cumbersome because it depends on the words and characters. In this regard, your way is very simpler :)

Collapse
 
claudiawu_ profile image
Claudia Wu.

Is this possible only on dev.to or is it a standard markdown thing too? Thank you for this! πŸ‘

Collapse
 
cescquintero profile image
Francisco Quintero πŸ‡¨πŸ‡΄

It's standard Markdown