首页 > 解决方案 > 如何在烧瓶中打开 HTML 页面中的特定部分

问题描述

我正在做一个烧瓶项目。我的主页在导航栏中包含关于、问题和联系人。index.html 包含导航栏的内容。关于、问题和联系部分在同一页上。因此,每当单击这些时,页面都会滚动到相应的部分

<li class="nav-item">
<a class="nav-link aaa height" href="#about">About</a>
<a class="nav-link aaa height" href="#problem">Problems</a>
<a class="nav-link aaa height" href="#contact">Contact</a>
</li>

现在在我的问题页面中,我有相同的导航栏,但是当我单击关于按钮时,它显示我找不到 URL。这是我的 python-flask 代码。

@app.route("/en/index#problem")
def index_about():
    return render_template('index.html#about')

如何从其他页面路由到关于部分的索引页面?

标签: pythonhtmlflask

解决方案


推荐阅读