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
Anchor tags not going to the right spot....
Old 09-24-2010, 09:58 AM Anchor tags not going to the right spot....
Junior Talker

Posts: 4
Name: Candace
Location: Ontario, Canada
Trades: 0
So, this is normally the most simple part of my job... add anchors at the bottom so that the user can go to a certain section of the site... well for some reason, I just can't get them to work... the site is:
www.locatorindustries.com/rivets.html
the anchor links are at the bottom - Home is a link to another page, The "Top of Page" anchor works, the "About Us" link makes the page move up, but not to the right spot, and the "About You" doesn't work at all (Don't worry about the "About Rivets" its silly it's there in the first place but it was a request from the company. I have floating divs, so I've tried the <a name="" id=""> in the image div, on the <p> tag for the title of each section in a blank div above each section, to no avail. Can anyone give me some insight into why the tags just won't work?
Let me know if you need any more info and I'll gladly give.
Cheers,
Candace
evraftrgraphics is offline
Reply With Quote
View Public Profile Visit evraftrgraphics's homepage!
 
 
Register now for full access!
Old 09-24-2010, 10:52 AM Re: Anchor tags not going to the right spot....
edgray's Avatar
Super Moderator

Latest Blog Post:
Frantic
Posts: 4,264
Name: Sugarcane Gray
Location: Hell, Southern Spain
Trades: 0
Can I ask why exactly you want the page to behave like this? I would say it's pretty pointless in usability terms.

On my screen, for example, pretty much the entire page shows up so there's little need for this at all.
__________________

Please login or register to view this content. Registration is FREE
- a project in video and sound.

Please login or register to view this content. Registration is FREE
"Absolute Rubbish, an insult to the blues." - NME.

Please login or register to view this content. Registration is FREE
- Come use our agency :)
edgray is offline
Reply With Quote
View Public Profile Visit edgray's homepage!
 
Old 09-24-2010, 10:58 AM Re: Anchor tags not going to the right spot....
Junior Talker

Posts: 4
Name: Candace
Location: Ontario, Canada
Trades: 0
I absolutely agree with you, it's an argument I lost with the client. I need to have it working.
evraftrgraphics is offline
Reply With Quote
View Public Profile Visit evraftrgraphics's homepage!
 
Old 09-24-2010, 11:08 AM Re: Anchor tags not going to the right spot....
edgray's Avatar
Super Moderator

Latest Blog Post:
Frantic
Posts: 4,264
Name: Sugarcane Gray
Location: Hell, Southern Spain
Trades: 0
Ok let me take a look at the code.
__________________

Please login or register to view this content. Registration is FREE
- a project in video and sound.

Please login or register to view this content. Registration is FREE
"Absolute Rubbish, an insult to the blues." - NME.

Please login or register to view this content. Registration is FREE
- Come use our agency :)
edgray is offline
Reply With Quote
View Public Profile Visit edgray's homepage!
 
Old 09-24-2010, 11:16 AM Re: Anchor tags not going to the right spot....
Junior Talker

Posts: 4
Name: Candace
Location: Ontario, Canada
Trades: 0
Thanks for any help you can give!!
evraftrgraphics is offline
Reply With Quote
View Public Profile Visit evraftrgraphics's homepage!
 
Old 09-24-2010, 11:55 AM Re: Anchor tags not going to the right spot....
edgray's Avatar
Super Moderator

Latest Blog Post:
Frantic
Posts: 4,264
Name: Sugarcane Gray
Location: Hell, Southern Spain
Trades: 0
As far as I can see the code is fine. I downloaded the HTML and opened it locally in Safari, and the anchors work perfectly when there's no graphics on the page.

I think the issue is that the anchors are contained within floating divs, which aren't part of the page flow. Try moving them to outside those floating divs. Should work fine then. Of course you'll always have a problem with the "About Rivets" section as it wouldn't be possible to take that to the top of the page on larger screens as there isn't enough below it.
__________________

Please login or register to view this content. Registration is FREE
- a project in video and sound.

Please login or register to view this content. Registration is FREE
"Absolute Rubbish, an insult to the blues." - NME.

Please login or register to view this content. Registration is FREE
- Come use our agency :)
edgray is offline
Reply With Quote
View Public Profile Visit edgray's homepage!
 
Old 09-24-2010, 11:56 AM Re: Anchor tags not going to the right spot....
Junior Talker

Posts: 4
Name: Candace
Location: Ontario, Canada
Trades: 0
Ok - Thanks! I'll give that a try!
Cheers!
Candace
evraftrgraphics is offline
Reply With Quote
View Public Profile Visit evraftrgraphics's homepage!
 
Old 09-24-2010, 12:15 PM Re: Anchor tags not going to the right spot....
edgray's Avatar
Super Moderator

Latest Blog Post:
Frantic
Posts: 4,264
Name: Sugarcane Gray
Location: Hell, Southern Spain
Trades: 0
Let me know how it goes.
__________________

Please login or register to view this content. Registration is FREE
- a project in video and sound.

Please login or register to view this content. Registration is FREE
"Absolute Rubbish, an insult to the blues." - NME.

Please login or register to view this content. Registration is FREE
- Come use our agency :)
edgray is offline
Reply With Quote
View Public Profile Visit edgray's homepage!
 
Old 09-24-2010, 08:00 PM Re: Anchor tags not going to the right spot....
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
The float has NOTHING to do with whether or not an anchor tag works!

For one thing, you should be using proper Heading tags, H1, H2, H3, etc., not styling paragraph text to LOOK like a heading. You can then easily define an anchor for "About Us" like this:

<h2 id="aboutus">About Us</h2>
Style the text in the CSS, which really should not be in-line either.
You reference the anchor the same way - <a href="#aboutus">link</a>
You have no anchor in your code at all for "about us", so the link has nowhere to go.

This also eliminates the need for extraneous <a> tags just to create an anchor.

Noticed in your css, on your main div, you have a float: left; and position:absolute both - they can't and won't work together, it's one or the other.
__________________
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


Last edited by LadynRed; 09-25-2010 at 04:17 PM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 09-25-2010, 07:47 AM Re: Anchor tags not going to the right spot....
edgray's Avatar
Super Moderator

Latest Blog Post:
Frantic
Posts: 4,264
Name: Sugarcane Gray
Location: Hell, Southern Spain
Trades: 0
Quote:
Originally Posted by LadynRed View Post
The float has NOTHING to do with whether or no an anchor tag works!
Well I didn't think so either. Yet, after downloading the page, and taking them outside of the floats, they work. Fancy that.

Quote:
Originally Posted by LadynRed View Post
For one thing, you should be using proper Heading tags, H1, H2, H3, etc., not styling paragraph text to LOOK like a heading. You can then easily define an anchor for "About Us" like this:

<h2 id="aboutus">About Us</h2>
Style the text in the CSS, which really should not be in-line either.
You reference the anchor the same way - <a href="#aboutus">link</a>
You have no anchor in your code at all for "about us", so the link has nowhere to go.
"about us" clearly points to "about2".

I would certainly recommend using appropriate heading tags, for SEO benefits if nothing else.

For a simple, small site such as this, there's nothing wrong with the odd bit of inline styling...
__________________

Please login or register to view this content. Registration is FREE
- a project in video and sound.

Please login or register to view this content. Registration is FREE
"Absolute Rubbish, an insult to the blues." - NME.

Please login or register to view this content. Registration is FREE
- Come use our agency :)

Last edited by edgray; 09-25-2010 at 07:52 AM..
edgray is offline
Reply With Quote
View Public Profile Visit edgray's homepage!
 
Old 09-25-2010, 04:20 PM Re: Anchor tags not going to the right spot....
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
It's not an 'odd bit' of inline styles, it's EVERYWHERE. It's inefficient and weighs down the page unnecessarily. It defeats one of the benefits of using css and that is the ability to change things site-wide by touching ONE file - the css file. With in-line styles like that you still have to touch every single page where any changes would need to occur.

The float has nothing to do with the anchors. It is likely more to do with the absolute and static positioning.. which is also largely unnecessary.
__________________
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 09-27-2010, 05:04 AM Re: Anchor tags not going to the right spot....
edgray's Avatar
Super Moderator

Latest Blog Post:
Frantic
Posts: 4,264
Name: Sugarcane Gray
Location: Hell, Southern Spain
Trades: 0
Quote:
Originally Posted by LadynRed View Post
It's not an 'odd bit' of inline styles, it's EVERYWHERE. It's inefficient and weighs down the page unnecessarily. It defeats one of the benefits of using css and that is the ability to change things site-wide by touching ONE file - the css file. With in-line styles like that you still have to touch every single page where any changes would need to occur.

The float has nothing to do with the anchors. It is likely more to do with the absolute and static positioning.. which is also largely unnecessary.
I totally agree with you in normal circumstances, however, I'm assuming the chap working on this site isn't intending on doing any style changes for this client, it sounds like what they were after was pretty specific and also that they're a difficult client. I'd have probably done the same in these circumstances.
__________________

Please login or register to view this content. Registration is FREE
- a project in video and sound.

Please login or register to view this content. Registration is FREE
"Absolute Rubbish, an insult to the blues." - NME.

Please login or register to view this content. Registration is FREE
- Come use our agency :)
edgray is offline
Reply With Quote
View Public Profile Visit edgray's homepage!
 
Reply     « Reply to Anchor tags not going to the right spot....
 

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 0.41598 seconds with 12 queries