By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,044 Members | 1,330 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,044 IT Pros & Developers. It's quick & easy.

Link to same page

100+
P: 119
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

links:

> heading 1
> heading 2
> heading 3

contents:

heanding1
xxxx
yyyyy
yyyy
yyyy

heading 2
xyz
xyz
xyz

heading 3
123
1231
123456

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,

Regards
magesh
Dec 12 '08 #1
Share this Question
Share on Google+
6 Replies


P: 12
I take it you mean the content section of the Wiki page.
Could you not use anchors on your headers?

eg.
<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

100+
P: 119
@Mr Prister
Hi

Thank you dude,

Regards
magesh
Dec 12 '08 #3

P: 12
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

Dormilich
Expert Mod 5K+
P: 8,639
@Mr Prister
except that whitespace is not allowed in an ID. (only letters, digits, underscores, hyphens, periods and colons)

regards
Dec 12 '08 #5

P: 12
@Dormilich

Damn you with your correctness and damn me for the mistake... but a valid point none the less.
Dec 12 '08 #6

Dormilich
Expert Mod 5K+
P: 8,639
@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.