多亏了dirn的评论,我设法将其与下面的代码一起使用。
传递
_anchor关键字以
url_for将锚添加到生成的URL。
导航菜单:
<a href="{{ url_for('.stuff', _anchor='exactlocation') }}">Go to specific id on suff page</a>烧瓶路线:
@main.route('/')def stuff(): return render_template('stuff.html')stuff.html:
...<section id="exactlocation">...



