用锚定标记Django链接url中另一个页面中的div
我正在尝试使用Django中的锚标记和url访问另一个页面中的div 这是一个html用锚定标记Django链接url中另一个页面中的div,django,url,anchor,Django,Url,Anchor,我正在尝试使用Django中的锚标记和url访问另一个页面中的div 这是一个html <a href="{% url 'anotherpage#show' %}>click here </a> 在另一页中 <div id="show">link to this div </div> 链接到此div 如何使用url访问showdiv 您需要先链接到该页面。然后链接到锚定 ## assume this will take you to th
<a href="{% url 'anotherpage#show' %}>click here </a>
在另一页中
<div id="show">link to this div </div>
链接到此div
如何使用url访问
show
div 您需要先链接到该页面。然后链接到锚定
## assume this will take you to the main page.
<a href="{% url 'anotherpage' %}>Page URL</a>
##假设这将带您进入主页。
然后,您所要做的就是在url标记之后添加所需的锚
<a href="{% url 'anotherpage' %}#show">Page URL to show directly. </a>
希望能有帮助 兄弟,你是个该死的冠军,我当然试着想出一个复杂的方法来使用参数来实现这一点。我不知道模板语言是如此彻底