單擊另一個頁面的鏈接后,我想將用戶重定向到特定選項卡。這是第1頁的代碼:index.html
<div class="products-btn">
<a href="products.html#pills-profile">view all</a>
</div>
第 2 頁 Products.html:
<ul class="nav nav-pills justify-content-center" id="pills-tab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="pills-home-tab" data-bs-toggle="pill" data-bs-
target="#pills-home" type="button" role="tab" aria-controls="pills-home" aria-
selected="true">products</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="solve" data-bs-toggle="pill" data-bs-target="#pills-
profile" type="button" role="tab" aria-controls="pills-profile" aria-
selected="false">solutions</button>
</li>
</ul>
我想將用戶從產品的 btn 重定向到解決方案選項卡。我在所有頁面中都使用引導程式 5.1。
uj5u.com熱心網友回復:
檢查根檔案夾并寫入從您index.html到的完整路徑products.html
然后添加這個
<a href="{your path to the page}/products.html#pills-tab">products</a>
示例:
我folder1在此檔案夾中命名了索引和檔案夾,還有另一個名為folder2包含產品頁面的檔案夾:
<a href="folder1/folder2/products.html">products</a>
另一個例子:
我想回到index.html:
<a href="../../index.html">products</a>
../意味著轉到上一個/父檔案夾
錨定Mozilla
uj5u.com熱心網友回復:
只需在“#”之后的鏈接中添加標簽的 ID
<a href="products.html#solve">view all</a>
uj5u.com熱心網友回復:
如果您想從 product.html 移動到 solution.html onclick,您可以使用 href:
<a href="solution.html">solution</a>
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/419505.html
標籤:
下一篇:我想多次獲取和插入一個屬性
