Anchor tags with divs

admin

Administrator
Staff member
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.<br />
<br />
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.<br />
<br />
Even though i've given each article an anchor name:<br />
<a name = "eg">Link</a> <br />
on the news page, then for the url for the scroller i have:<br />
<a href = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"newspage.html#eg">Read Full Story</a><br />
<br />
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?<br />
<br />
Thanks.<!--content-->The part of code you have posted is correct. Possible reasons:<br />
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.<br />
2. You are doing something wrong somewhere else. Possibly an open tag or forgot to close quotes. You may run your page thru HTML validator (<!-- m --><a class="postlink" href="http://validator.w3.org/">http://validator.w3.org/</a><!-- m -->) to check for errors or provide us link to this page.<!--content-->First of all - you were right - a stupid unclosed tag. But now it works i've come across a bigger problem.<br />
<br />
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:<br />
<br />
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. <br />
<br />
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.<br />
<br />
<br />
If anyone can offer any help i will greatly appreciate it.<!--content-->
 
Back
Top