Dear All,

Hello..!

I have one problem with html links.

Suppose we want to set the link in our html document, we use <a href="filename.html"> Link </a>
Suppose we want to go to a particular section to other html document then we use <a href="filename.html#name> Link </a>. Here in this case, we have to set the "name" attribute to filename.html.

But suppose i want to go to the particular section on the other website (which is already on internet. Suppose wikipedia).
Then what is the procedure.?
I am using the following code.
<a href="http://en.wikipedia.org/wiki/HTML#Techniques"> Link <a>.
The above link send me to "http://en.wikipedia.org/wiki/HTML", but i can not reach to word "Techniques".

Anybody can help me for this.

Can anybody provide me the code for link, by using which we can go to the particular section of the existed website.

Thank you very much,

Nakul Pancholi

Recommended Answers

All 2 Replies

Nakul,

A hyperlink's href is just a way to send your browser to another page without you having to type its URL into your browser's address bar.

To write a hyperlink, you work backwards, as follows :

  1. In browser, navigate to the Wikipedia page you want to link to (the Techniques entry).
  2. Select/Copy the url from the browser's address bar.
  3. In your text editor, Paste into the href="..." of an <a> tag (exactly as you have been doing).
  4. Save your file, then browse it in your browser.
  5. Click the link - it should take you back to the Wikipedia page where you started in Wikipedia.

There are many many good internet resources on this and related subjects. Try this for example.

Airshow

the link target href has to be defined by a 'name' attribute in the target page,
If you are attempting to hit a particular point on the target page, examine the link on that page and use that as your target, the target page may not be using the title you expect as the name attribute

note: the target does not reflect a word in the text, only a name attribute in a html element
ie on the target page

  • <span name='fred">Fred</span> can be reached by a link with the href #fred
  • <span name='title">Fred</span> cannot be reached by a link with the href #fred the href would be #title
  • <span>Fred</span> cannot be reached by a targeted link to the page, no name attribute
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.