...

View Full Version : how to make this reference-link work?



littlestone
07-10-2011, 06:57 AM
Dear All


Suppose I want to make a one page html like the following:



***************
Table of Contents

Part 1
part 2
Part 3

***************

Part 1

...blah blah blah....Those will be contents for part 1...blah blah blah....

Part 2

...Those will be contents for part 2...

Part 3

...blah blah blah....Those will be contents for part 3...blah blah blah....


What I want to do is: I want to make those words in red (Part 1, Part 2, Part 3 )as links to their corresponding contents; for example, if visitors click part 2, the page will automatically navigate to



Part 2

...Those will be contents for part 2...


How should I write HTML and/or CSS to make those links possible?
Thank you very much!

Sammy12
07-10-2011, 07:22 AM
<a href="#logo"></a>

http://www.ipowerweb.com/iboost/build/programming/html/basic/782.htm

I usually use:


<a href="#yada"></a>
<a href="#rada"></a>

<h2 id="yada"></h2>
<h2 id="rada"></h2>


^ not sure whether that works :P I don't use internal links very often. The link I provided is the "correct" way of doing it

vikram1vicky
07-10-2011, 10:04 AM
Dear All


Suppose I want to make a one page html like the following:



What I want to do is: I want to make those words in red (Part 1, Part 2, Part 3 )as links to their corresponding contents; for example, if visitors click part 2, the page will automatically navigate to


How should I write HTML and/or CSS to make those links possible?
Thank you very much!

Following is the code what you want ..... :)

<p>***************</p>
<p>Table of Contents </p>
<ol>
<li><a href="#part1">Part 1</a></li>
<li><a href="#part2">part 2</a></li>
<li><a href="#part3">Part 3</a></li>
</ol>
<p>***************</p>
<a name="part1">
<DL>
<DT>Part 1</DT>
<DD>...blah blah blah....Those will be contents for part 1...blah blah blah....</DD>
</DL>
<a name="part2">
<DL>
<DT>Part 2</DT>
<DD>...Those will be contents for part 2...</DD>
</DL>
<a name="part3">
<DL>
<DT>Part 3</DT>
<DD>...blah blah blah....Those will be contents for part 3...blah blah blah....</DD></DL>

littlestone
07-10-2011, 03:34 PM
Thank you all for great help.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum