DEV Community

PALLAVI SINGH
PALLAVI SINGH

Posted on

HOW TO MAKE ANCHOR LINKS WORK IN MY DEV POST? ANYONE PLEASE HELP.

Discussion (10)

Collapse
inhuofficial profile image
InHuOfficial

Convert your section headings to level 2 headings as those are correct for your structure:

## Let’s recall some basics
Enter fullscreen mode Exit fullscreen mode

Then if you right click and inspect them in the preview panel you will see they have an ID so you copy that and a # to the start and use that as your link (the part in the parenthesis)

[Let’s recall some basics](#Lets-recall-some-basics)
Enter fullscreen mode Exit fullscreen mode
Collapse
pallavi121 profile image
PALLAVI SINGH Author

Thankyou so much :)

Collapse
inhuofficial profile image
InHuOfficial

No problem, you haven't quite got it right (nearly there).

The links should be all lower case and you need to remove things like question marks etc.

So #lets-recall-some-basics (lower case "l") and #concept-of-padding (lower case "C") and #why-structure-padding (lower case "W" and remove the question mark).

Thread Thread
pallavi121 profile image
PALLAVI SINGH Author

Yaa got it right.

Collapse
moopet profile image
Ben Sinclair

What are you trying to do, and what have you tried so far?

When you create a post here, there's a help section to the right with the basics (including links) and a link off to more information about markdown.

Essentially you do this:

[Hello I am the text of a link](https://dev.to/foobar)
Enter fullscreen mode Exit fullscreen mode

If that's not what you're having trouble with, ask away.

Collapse
pallavi121 profile image
PALLAVI SINGH Author

please check my recent post , if you click on any topic in the topics section it will not take you to the particular section. Please look into it and help i have tried the above method it's not working.

Collapse
moopet profile image
Ben Sinclair • Edited

When you made this post, it was your only post. You hadn't published the other one so nobody could see it to offer you any help.

Thread Thread
pallavi121 profile image
PALLAVI SINGH Author

Now i have published the other one , my query is resolved. thankyou for the help :)

Collapse
willnode profile image
Wildan Mubarok

Let me test this

If clicking that link scrolls to title, it works then.

Let me [test this](#main-title)
Enter fullscreen mode Exit fullscreen mode
Collapse
pallavi121 profile image
PALLAVI SINGH Author

Thankyou so much:)