Link to a specific div in another app(page) in Django using anchor tag

1.4k views Asked by At

I have a div with a certain id

<div id="services">

Then I try to link to it using Django templates

<a href="{% url 'homepage' %}#services">

But it only works if I'm in the same page (App) Is there a way to work around this ?

1

There are 1 answers

0
Zeyad Obaia On BEST ANSWER

I found out what the problem was. I had a script that does smooth scrolling and it had "event.preventDefault();" in it. as I removed that it worked.