Articles

How to Link to a Particular Line or Paragraph on a Web Page Using HTML

by Koushik Kk
LINKING TO SPECIFIC HEADING ON A WEB PAGE CAN BE DONE USING ANCHORS LET ME EXPLAIN WITH A CODE

Step 1

<body>
<h2>paragraph 1</h2>
<p>
this para will be used to as an introduction to this example in this example we will link to the next heading
</p>
<h2>this is the linked para<h2>
<p>
hope this example will help you to mlearn this process all the best
</p>
</body>

above code is a code for a simple page with 2 heading and two paragraphs
 
if you would like to link to each heading you must add an anchor to each of it

please see what i am adding to the code

<body>
<h2>< a name="link1">paragraph 1</a></h2>
<p>
this para will be used to as an introduction to this example in this example we will link to the next heading
</p>
<h2><a name="link2">paragraph 2</a><h2>
<p>
hope this example will help you to learn this process all the best
</p>
</body>

the newly added code in an anchor it is the first step in linking process (newly added code ins marked in red )

note: you can replace link1 and link2 with any name you would prefer

Step  2

This is the link code for linking to paragrah 1 from any other website


<a href =http://www.yoursiteorblog.com/any-page.html#link1">paragraph 1</a>

This code can be used to link from the same page but above code can be used for doing it too

<a href="#link1">paragraph 1</a>

code for linking to paragraph 2  from any other website

<a href =http://www.yoursiteorblog.com/any-page.html#link2">paragraph 2</a>

This code can be used to link in same page
 
<a href="#link2">paragraph 2</a>

Note:replace link1 and link2 with the anchor name (<a name="anything you used in last step ">)

Hope this howto was helpful to you

for more helpful articles,videos please click here and install my toolbar


Sponsor Ads


About Koushik Kk Innovator     

10 connections, 0 recommendations, 55 honor points.
Joined APSense since, October 15th, 2008, From chennai, India.

Created on Dec 31st 1969 18:00. Viewed 0 times.

Comments

No comment, be the first to comment.
Please sign in before you comment.