/    Sign up×
Community /Pin to ProfileBookmark

Anchor tags with divs

For the content of the news section of my web page, i have placed it all in a div, with an up/down image to scroll it. Nothing new here.

For the index/ homepage, i’ve got a news scroller, and when the user clicks on a link in the news scroller, i want it to take them to that article on the news page.

Even though i’ve given each article an anchor name:
<a name = “eg”>Link</a>
on the news page, then for the url for the scroller i have:
<a href = “newspage.html#eg”>Read Full Story</a>

its only taking me to the page, not to the point in the page where the anchor tag appears. I was wondering if this is because the content is in a div tag, and if so, does anyone know a way to make it go to the relevant portion of the div?

Thanks.

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@nkaisareAug 13.2003 — The part of code you have posted is correct. Possible reasons:

1. A page cannot scroll beyond the end of page. If your <a name="eg"> comes close to the bottom of the page, you cannot scroll until there.

2. You are doing something wrong somewhere else. Possibly an open tag or forgot to close quotes. You may run your page thru [url=http://validator.w3.org/]HTML validator[/url] to check for errors or provide us link to this page.
Copy linkTweet thisAlerts:
@moondanceauthorAug 14.2003 — First of all - you were right - a stupid unclosed tag. But now it works i've come across a bigger problem.

I've uploaded the files, hopefully someone can have a look at them and tell me what the probelm is. I included a readme file but heres a brief description:

The headline scoller is on the index page. When the user clicks on a link in the headline scroller, it will take them to the relevant section on the news page, but then i can't scroll up - to view any content above.

I am using a javascript / div scroller type thing on the news page, and think the probelm lies in the javascript - so the moderators may move this post to the javascript forum if necessary.


If anyone can offer any help i will greatly appreciate it.

[upl-file uuid=110573af-bae6-4e9d-b1bc-e2b149c958ca size=9kB]news test.zip[/upl-file]
×

Success!

Help @moondance spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...