我正在尝试使用Django中的定位标记和URL访问另一个页面中的div。
这是HTML,
<a href="{% url 'anotherpage#show' %}>click here </a>
在另一页中
<div id="show">link to this div </div>
如何show使用网址访问div?
您需要先链接到页面。然后链接到Anchor
## 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>
希望能帮助到你。