Making my own TOC in basic html ... Need to center page on link content

dalearyous

[H]ard|Gawd
Joined
Jun 21, 2008
Messages
1,922
So i have a table of contents that i made with basic formatting and links to information in the same page. Clicking on the link moves the page so you can see the text but i want it centered...How do you do that?

If thats confusing,

Article 1
Article 2
Article 3
Article 4

Article 1 (really long article):
blah
blah
blah

Article 2

When i click on article 2 the browser moves show that article 2 shows up at the bottom of the page so i can see it, but its not in the center of the page.
 
Clicking on the link moves the page so you can see the text but i want it centered...How do you do that?

What do you mean by 'centered'? Perhaps you're looking for HTML Anchors? If that's what you're already using, I'm not sure what you're looking for then.
 
Yup, sounds like HTML anchors. Though the OP's desired result, while stated objectively, creates a subjective solution that may not consistently work for many users due to different browser window heights/widths and content length.
 
I think he means a horizontally centered content section on the page, but the wording was confusing at best. If that's the case then some CSS would be in order.
 
I think he means a horizontally centered content section on the page, but the wording was confusing at best. If that's the case then some CSS would be in order.
A good point, and I agree with you that the OP needs to specify which interpretation was meant.



Edit: Though even after re-reading the first post, the comment below tells me the OP is referring to vertical (scroll) position of the anchored content. But I'm interested in seeing what the OP meant.
When i click on article 2 the browser moves show that article 2 shows up at the bottom of the page so i can see it, but its not in the center of the page.
 
Last edited:
I think he means anchor, if thats the case you can mess with putting the <a name="article2"> tag in different places.
 
I think he means anchor, if thats the case you can mess with putting the <a name="article2"> tag in different places.
That much has already been established. However, the pending question on this topic concerns how far the anchor should scroll; repositioning the linked-to anchor tag alone would not provide a consistent solution for what I posted previously. But that concern is still pending clarification from the OP.
 
Back
Top