0

As the title says, what I want to do is after clicking a link I go to some section in another page, and that section should scroll to top. Also, I don't want to use jquery for this, I only want to use html. Thanks! following is the code from the original page:

<TABLE cellspacing="11px" style="margin-left:3px">
               <TR>
                  <TD><A href="detail.html#patents">PATENT</A></TD>
                  <TD><A href="detail.html#trademarks">TRADEMARKS</A></TD>
                  <TD><A href="detail.html#ipLawAndPolicy">IP LAW & POLICY</A></TD>
                  <TD><A href="detail.html#productsAndServices">PRODUCTS & SERVICES</A></TD>
                  <TD><A href="detail.html#inventors">INVENTORS</A></TD>
                  <TD><A href="detail.html#newsAndNotices">NEWS & NOTICES</A></TD>
                  <TD><A href="detail.html#faqs">FAQs</A></TD>
               </TR>
            </TABLE>

Following is the code from target page:

<BODY>
      <P id="patents">PATENTS</P>
      <HR />
      <P id="trademarks">TRADEMARKS</P>
      <HR />
      <P id="ipLawAndPolicy">IP LAW & POLICY</P>
      <HR />
      <P id="productsAndServices">PRODUCTS & SERVICES</P>
      <HR />
      <P id="inventors">INVENTORS</P>
      <HR />
      <P id="newsAndNotices">NEWS & NOTICES</P>
      <HR />
      <P id="faqs">FAQs</P>
   </BODY>
4

2 回答 2

1

如果您只想跳转到页面的特定部分,请在目标处使用以下代码:

<a name="targetName"/>

并链接到 targetPage.html#targetName。此处的 targetName 只是一个示例,请使用适合您链接到的部分的内容。

如果您需要在目标页面的底部添加空格,您可以执行以下操作,例如将以下内容添加到页面底部(之前</body>):

<div style="height: 1000px"></div>
于 2012-09-12T02:27:54.853 回答
0

听起来您需要 HTML 书签:

http://www.ezineasp.net/post/HTML-Anchor-Bookmark-Tag-Links.aspx http://www.freewebmasterhelp.com/tutorials/html-basics/4

于 2012-09-12T02:27:07.677 回答