Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Return to top HTML code
Old 01-12-2008, 10:50 PM Return to top HTML code
Novice Talker

Posts: 11
Trades: 0
Hello and thanks in advance,

I have in some sections of the page some links to "return to the top of the page".

It works perfectly with IE but not in firefox.

Can you please tell me what's wrong?

<a href="#top-top" target="_self">Return to top</a>


Thanks/regards
__________________

Please login or register to view this content. Registration is FREE
Non-profit, non-commercial, always free.
jeron30 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-12-2008, 11:32 PM Re: Return to top HTML code
Skilled Talker

Posts: 52
Name: Dustin
Trades: 0
Well, I'm not sure about IE, but I know that in firefox you don't need the: target="_self" part. Technically I don't see why you would need it in IE either, although IE is quirky sometimes so who knows. Hope that helps.
__________________

Please login or register to view this content. Registration is FREE
TributeK is offline
Reply With Quote
View Public Profile
 
Old 01-12-2008, 11:49 PM Re: Return to top HTML code
Novice Talker

Posts: 11
Trades: 0
Nope, it didn't work...
__________________

Please login or register to view this content. Registration is FREE
Non-profit, non-commercial, always free.
jeron30 is offline
Reply With Quote
View Public Profile
 
Old 01-12-2008, 11:54 PM Re: Return to top HTML code
Skilled Talker

Posts: 52
Name: Dustin
Trades: 0
Oh yeah, forgot to ask. Did you make an anchor point at the top of your page? I think it's called an anchor point. Pick the first word at the top of the page. EX: <a name="top-top">firstword</a>. your href="#top-top" should work then.

I know that if you don't want that firstword to look like a link, and this works in firefox, can't say for other browsers, that you can put: <a name="top-top"></a>firstword :which makes firstword an anchor point without making it appear to be a link. Does this work for you? Also, can I view your page?
__________________

Please login or register to view this content. Registration is FREE
TributeK is offline
Reply With Quote
View Public Profile
 
Old 01-13-2008, 12:20 AM Re: Return to top HTML code
Novice Talker

Posts: 11
Trades: 0
Yes I did. The thing is that EVERYTHING works just fine in IE but not in firefox.
__________________

Please login or register to view this content. Registration is FREE
Non-profit, non-commercial, always free.
jeron30 is offline
Reply With Quote
View Public Profile
 
Old 01-13-2008, 12:32 AM Re: Return to top HTML code
Skilled Talker

Posts: 52
Name: Dustin
Trades: 0
Sounds fishy to me. I just tested this out on my blog. Try it on my homepage.
All I did was put this in the horizontal menu:

<a name="top"></a>TOP

And at the bottom, in the footer, I put this:

<a href="#top">Back to top</a>

Works perfect in firefox and IE for me.
__________________

Please login or register to view this content. Registration is FREE
TributeK is offline
Reply With Quote
View Public Profile
 
Old 01-13-2008, 01:11 AM Re: Return to top HTML code
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
You may want to give a link to your site. Perhaps there's a validation issue that's causing your HTML to misinterpret things.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-13-2008, 04:24 AM Re: Return to top HTML code
The Lion's Avatar
Novice Talker

Posts: 12
Name: David
Trades: 0
Not a problem. All you need to do is ID any section of text at the top of the page (ex: <p id="linkid">). Then adjust your <a href> line to read more like this: <a href="http://www.yoursite.com/yourpage#linkid.html">.

I'm sure there's some JavaScript that can do the same thing, but this is the way I did it on one site. And it should work no matter what browser you use...

Good luck,
The Lion.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by The Lion; 01-13-2008 at 04:26 AM..
The Lion is offline
Reply With Quote
View Public Profile
 
Old 01-13-2008, 11:43 AM Re: Return to top HTML code
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Quote:
Originally Posted by The Lion View Post
Not a problem. All you need to do is ID any section of text at the top of the page (ex: <p id="linkid">). Then adjust your <a href> line to read more like this: <a href="http://www.yoursite.com/yourpage#linkid.html">.

I'm sure there's some JavaScript that can do the same thing, but this is the way I did it on one site. And it should work no matter what browser you use...

Good luck,
The Lion.

This is just plain wrong. # in a URL takes you to an anchor or the top of the page if the anchor doesn't exist. JavaScript isn't necessary and would be a silly amount of wasted work given that anchors exist. When linking to an anchor, you don't put the #anchor_name before the file extension. Just delete that post from your head.

It's actually not very hard to do what you want:

HTML Code:
<html>
  <head>
    <title>Example</title>
  </head>
  <body>
  <a name="page_top"></a>
  <div style="background-color:#ff0000;height:2000px;"></div>
  <a href="#page_top">Back To Top</a>
  </body>
</html>
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-13-2008, 12:07 PM Re: Return to top HTML code
Novice Talker

Posts: 11
Trades: 0
Initially I didn't want to list my URL because I was afraid of getting in trouble with the administrator of the forum but, thanks "JeremyMiller" I have fixed it looking at your code.

It works perfectly.


Thanks a bunch!!!!!!!!!!
__________________

Please login or register to view this content. Registration is FREE
Non-profit, non-commercial, always free.
jeron30 is offline
Reply With Quote
View Public Profile
 
Old 01-13-2008, 12:20 PM Re: Return to top HTML code
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Glad you got it. Listing your URL for a help question won't get you banned. It's when you post your link for the sole purpose of having a link. Sometimes, without the code it's impossible to help. This, fortunately, was easy enough.

Don't forget, you can put links in your signature, but read the rules first as they are a couple of restrictions.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-13-2008, 12:30 PM Re: Return to top HTML code
Novice Talker

Posts: 11
Trades: 0
Got it
__________________

Please login or register to view this content. Registration is FREE
Non-profit, non-commercial, always free.
jeron30 is offline
Reply With Quote
View Public Profile
 
Old 01-13-2008, 01:19 PM Re: Return to top HTML code
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
This is just plain wrong. # in a URL takes you to an anchor or the top of the page if the anchor doesn't exist.
No, it is not wrong. Using the ID method DOES work properly in ALL browsers and it is preferable to using the old <a name=..."> method. Javascript is not necessary either. Using ID's is cleaner and more semantically correct, and it reduces extra unnecessary code too.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 01-13-2008, 01:54 PM Re: Return to top HTML code
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
I stand corrected! Thanks Lady. When I first tested, I tested it to work at only the top. This code, however, demonstrates the accuracy of your statement:

HTML Code:
<html>
  <head>
    <title>Example</title>
  </head>
  <body>
  <div style="background-color:#ff0000;height:2000px;"></div>
  <p id="page_top">Here's where to go.</p>
  <div style="background-color:#0000ff;height:2000px;"></div>
  <a href="#page_top">Back To Top</a>
  </body>
</html>
Do you know when that was made so? I've never until now seen this!

I love every day where I learn something absolutely new to me!
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-13-2008, 06:37 PM Re: Return to top HTML code
Novice Talker

Posts: 8
Trades: 0
yeah, Every day is a new day. Although, I code a lot I saw this today. Perhaps, I did'nt take out time to upgrade my knowledge. The ID tag looks simple and effective to me too. Will use it next time I need it. Thanks lady for this update

Quote:
Originally Posted by JeremyMiller View Post
I stand corrected! Thanks Lady. When I first tested, I tested it to work at only the top. This code, however, demonstrates the accuracy of your statement:

HTML Code:
<html>
  <head>
    <title>Example</title>
  </head>
  <body>
  <div style="background-color:#ff0000;height:2000px;"></div>
  <p id="page_top">Here's where to go.</p>
  <div style="background-color:#0000ff;height:2000px;"></div>
  <a href="#page_top">Back To Top</a>
  </body>
</html>
Do you know when that was made so? I've never until now seen this!

I love every day where I learn something absolutely new to me!
cool_b is offline
Reply With Quote
View Public Profile
 
Old 01-13-2008, 07:48 PM Re: Return to top HTML code
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You're welcome
I can't tell you when it came into being.. so to speak.. but I've been using IDs for anchors for quite some time now. Since it rarely clashes with IDs in my css, it works like a charm.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 01-15-2008, 12:26 PM Re: Return to top HTML code
Novice Talker

Posts: 9
Trades: 0
It's just <a href="#">top</a>.
idezmax is offline
Reply With Quote
View Public Profile Visit idezmax's homepage!
 
Old 02-26-2008, 12:06 PM Re: Return to top HTML code
Novice Talker

Posts: 11
Trades: 0
Thanks you to you all.

It was fixed.



Maybe I should close this thread....if I can find the way...
__________________

Please login or register to view this content. Registration is FREE
Non-profit, non-commercial, always free.
jeron30 is offline
Reply With Quote
View Public Profile
 
Old 02-26-2008, 02:29 PM Re: Return to top HTML code
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
<a href="#" name="top" id="top"></a>
Completely unnecessary. The ID is all that is needed and it can be added to ANY element without the need for the extraneous link code.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-28-2008, 03:29 PM Re: Return to top HTML code
Banned

Posts: 143
Name: Blake
Location: Cuyahoga falls,Ohio
Trades: -2
Ok,ahah i had the same question About Anchor Links and i had to stop and think!!! what i was doing wrong If youre using divs for the Main Layout of youre Page wherever you want that Link to Bring you back to the top to go all u do is Put a Link <a href="#lets say Layer2">And this Link takes you to Layer to </a>


Its seemed hard at first But then U look at it and its just one of those things that fly over youre Head when youre Really Concentrating
blktallos is offline
Reply With Quote
View Public Profile Visit blktallos's homepage!
 
Reply     « Reply to Return to top HTML code
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.81027 seconds with 12 queries