2017-04-10 78 views
0

我试图链接然而,跳跃到不同部分在同一页面上越往下,我的网页上的文字,当我的类添加到内联网页的一部分时, div和在href的链接词,它会打开一个新的页面,上面写着“未找到”“Not Found”错误在同一页

我在做什么错?

HTML:

<div class="paragraph">If you are installing panels on both walls and 
ceiling, it is recommended to do the ceiling first. The ceiling can also be 
installed at a later date. 
<ul><li>See warnings on Radiant Tube Heater installation - <em>Section 
5.3</em></li> 
<li>See Special Instructions&nbsp;for installation in cold temperatures - 
<em>Section 5.1</em></li> 
<li>See Recommended Fasteners - <em><u><a 
href="recommended_fasteners">Section 4.1</a></em></u></li></ul></div> 

<div class="recommended_fasteners" 
style="text-align:right;"> 
<strong>SECTION 4.1</strong></div> 

提前感谢!

回答

2

你是有缺失的哈希值。为了确保您不会从该页面导航,您需要为URL添加散列。使用此:

<div class="paragraph">If you are installing panels on both walls and 
 
ceiling, it is recommended to do the ceiling first. The ceiling can also be 
 
installed at a later date. 
 
<ul><li>See warnings on Radiant Tube Heater installation - <em>Section 
 
5.3</em></li> 
 
<li>See Special Instructions&nbsp;for installation in cold temperatures - 
 
<em>Section 5.1</em></li> 
 
<li>See Recommended Fasteners - <em><u><a 
 
href="#recommended_fasteners">Section 4.1</a></em></u></li></ul></div><br><br><br><br><br><br><br><br><br><br><br> 
 

 
<div id="recommended_fasteners" 
 
style="text-align:right;"> 
 
<strong>SECTION 4.1</strong></div>

+0

这样的作品,太感谢你了!我现在唯一想要的是,当页面跳转到该部分时,标题“部分4.1”出现在文本上方,而不是切断“部分4.1”标题。有没有办法可以做到这一点? – Kaylee

+0

@Kaylee我没有明白。你能多解释一下吗? – mehulmpt

+0

您的技术用于跳转到页面的不同部分。但是当它跳到这一点时,窗口顶部将切断标题“4.1节”,只显示标题“4.1节”下面的文本,其后是页面的其余部分。我怎样才能做到这一点,因此当它跳到页面的那一部分时,窗口顶部的标题“4.1节”不会被截断? – Kaylee

相关问题