HTML: Need to make links go to a specific scroll position

I have a Website with some news headlines on the home page. Then there is another long, scrolling page with the news stories. Each story is accessed by scrolling at the moment, but I want the page to scroll automatically to the appropriate story when a headline is clicked.

I know this is possible but I've never done it before.

If it's not possible in HTML then I can use aspx 2.0 (VB) or java.


LVL 11
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You use what is called the Anchor Tag:

Your link will be something like this: <a href="your_page.html#news1">News 1</a>

Place this in the location of the page you want to jump to: <a name="news1"></a>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jason210Author Commented:
Looks simple enough but it's not working for me. Does it work if the <name =""></a> tag is in a table row? WIll it go to that particular row or will it just show the table from the top?
Jason210Author Commented:
Ok, I broke the table up into small tables with the named anchors in between each table, but it's still taking me to the top of the page.
Jason210Author Commented:
Page 1 entry...

<a href="news1.html#20070604" target="main" class="link2">Today's News</a>

Page 2 entry

<a name="20070604"></a>
<table style="width:100%;background-color:#FFffFF;" cellspacing="0" cellpadding="0" border="0">

Of course the table information continues and ends with a </table>

But the anchors aren't working.

Jason210Author Commented:
If no-one can help me with this I'll have to delete it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.