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?
rbudjConnect With a Mentor Commented:
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>
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.
All Courses

From novice to tech pro — start learning today.