Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用锚定标记Django链接url中另一个页面中的div_Django_Url_Anchor - Fatal编程技术网

用锚定标记Django链接url中另一个页面中的div

用锚定标记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

我正在尝试使用Django中的锚标记和url访问另一个页面中的div

这是一个html

<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>


希望能有帮助

兄弟,你是个该死的冠军,我当然试着想出一个复杂的方法来使用参数来实现这一点。我不知道模板语言是如此彻底