问题
I want a link in my webpage header bar that points to a certain part of a page (for example, the lower half). It's easily done with pure HTML but I wonder how to do it in django.
HTML version:
In base.html:
<a href="/entrance.html#intro">Introduction</a>
In entrance.html:
<a name="intro"></a>
How can I do the same thing in django? Any better solutions than just writing one more view function?
回答1:
There is no difference in doing it with Django when compared to just normal HTML. Just continue doing it the HTML way.
来源:https://stackoverflow.com/questions/37236314/django-how-to-link-to-some-part-of-a-page