Django how to link to some part of a page

倖福魔咒の 提交于 2020-06-01 03:58:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!