471,895 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,895 software developers and data experts.

Link to same page

119 100+
Hi to all,

I am trying to do some link management in my page, that is i have few contents in my page each have his own headings, like


> heading 1
> heading 2
> heading 3



heading 2

heading 3

Now what i want to do is, i want to create a link for every headings like

<a href=#heading1>heading1</a>

When the user clicks in that link, then the content for that link should come up to the front,

this task is already furnished in wikipedia - sample

i want the same process for my page..

Can anyone help me please,

Thanks in advance,

Dec 12 '08 #1
6 4753
I take it you mean the content section of the Wiki page.
Could you not use anchors on your headers?

<a name = "header1">heading 1</a>
Header 1 Contents

Then for you link just <a href = "#header1"> Header 1 </a>

Is that what your looking for?
Mr. Prister
Dec 12 '08 #2
119 100+
@Mr Prister

Thank you dude,

Dec 12 '08 #3
Hi there... no probs,

Just thought if you actually using header tags

eg. <h1>Header 1</h1>

Then you can simply give the header an ID:
<h1 id = "header 1">Header 1</h1>
Then reference that just like you would the anchor.

I don't think it matters which you use but that one looks nice!
Dec 12 '08 #4
8,658 Expert Mod 8TB
@Mr Prister
except that whitespace is not allowed in an ID. (only letters, digits, underscores, hyphens, periods and colons)

Dec 12 '08 #5

Damn you with your correctness and damn me for the mistake... but a valid point none the less.
Dec 12 '08 #6
8,658 Expert Mod 8TB
@Mr Prister
damn yes. I'm sure there are a lot of people out there who do not know that fact.
Dec 12 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by crhaynes | last post: by
3 posts views Thread by VIJAY KUMAR | last post: by
1 post views Thread by Aki | last post: by
26 posts views Thread by Harrie | last post: by
36 posts views Thread by randau | last post: by
6 posts views Thread by Andreas Prilop | last post: by
2 posts views Thread by Keith G Hicks | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.