Switch to full style
HTML code examples
Post a reply

link to parts in the same page

Fri Dec 09, 2011 1:36 am

Following is an example about how you can make links but within the page itself, this type of links is mainly used for jumps between the different parts in the same page specially if this page long.You can find these types of usage in forums as "Top" button and also in many of the articles websites.


Code:

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
  <title>link to parts in the same page</title>
</head>

<body>
<h1><a name="top">Please choose your section</a></h1>
<p>There are four sections :</p>
  <ul>
    <li><a href="#section0">section0</a></li>
    <li><a href="#section1">section1</a></li>
    <li><a href="#section2">section2</a></li>
    <li><a href="#section3">section3</a></li>
  </ul>
<h2><a name="section0">section0</a></h2>
<p>Description of section 0</p>
<p>Description of section 0</p>
<p>Description of section 0</p>
<p>Description of section 0</p>
<p>Description of section 0</p>

<p><a href="#top">Back to top</a></p>

<h2><a name="section1">section1</a></h2>
<p>Description of section 1</p>
<p>Description of section 1</p>
<p>Description of section 1</p>
<p>Description of section 1</p>
<p>Description of section 1</p>
<p><a href="#top">Back to top</a></p>

<h2><a name="section2">section2</a></h2>
<p>Description of section 2</p>
<p>Description of section 2</p>
<p>Description of section 2</p>
<p>Description of section 2</p>
<p>Description of section 2</p>
<p><a href="#top">Back to top</a></p>

<h2><a name="section3">section3</a></h2>
<p>Description of section 3</p>
<p>Description of section 3</p>
<p>Description of section 3</p>
<p>Description of section 3</p>
<p>Description of section 3</p>
<p><a href="#top">Back to top</a></p>

</body>
</html>




Post a reply
  Related Posts  to : link to parts in the same page
 get current page link     -  
 how to screen scrape or grab some parts of a website?     -  
 Image Scroller-scrollbar-LINE_UP,LINE_DOWN-PAGE-UP-PAGE-DOWN     -  
 add link in asp.net     -  
 Different statuses for link by CSS     -  
 Link send     -  
 Changing link color     -  
 set MIME type in link     -  
 Underline for visited link     -  
 inline style for link tag.     -  

Topic Tags

HTML Link