6 replies [Last post]
istuartw
Offline
Regular
Last seen: 17 years 21 weeks ago
Joined: 2005-02-08
Posts: 13
Points: 0

OK, this sounds like really basic stuff, but I can't figure out what the problem is.

Placing the following in an shtml doc:

<p>Visit <a href="index.shtml#section2">Section 2</a> for more info.</p>

and somewhere within index.shmtl:

<a name="section2"></a>
<p>Section 2</p>

That link should load the home page so "Section 2" is at the top of the browser window, right?

Well, IE is not doing it. Instead, it is loading the page a few inches below the anchor, cutting off some of the targetted content. Mozilla does it fine, and IE seems to read this code in other webpages without trouble, but not for me.

Is there any reason why IE would be doing this?

Thanks!

Ian

Tags:
antibland
antibland's picture
Offline
Leader
Pittsburgh
Last seen: 13 years 25 weeks ago
Pittsburgh
Joined: 2005-01-17
Posts: 603
Points: 0

IE and page anchors - what the heck?

Try this:

<a name="section2" id="section2"></a>

Antibland

istuartw
Offline
Regular
Last seen: 17 years 21 weeks ago
Joined: 2005-02-08
Posts: 13
Points: 0

Didn't work

Thanks, Antibland, but it didn't work.

This is insane, I've tried so many different methods of anchoring and IE keeps doing the same thing, and just on my website.

I

Anonymous
Anonymous's picture
Guru

Re: Didn't work

Link please?

istuartw
Offline
Regular
Last seen: 17 years 21 weeks ago
Joined: 2005-02-08
Posts: 13
Points: 0

Here ...

I hesitated with a link because it's a political website (satire on the Republican Party). But just for an easy example, go to

http://www.republicandictionary.com/rd_a.shtml

with IE (I'm using IE 6.Innocent, and click on any of the underlined links and see how IE loads the page too far down.

Thanks!

I

Anonymous
Anonymous's picture
Guru

Re: Here ...

istuartw wrote:
I hesitated with a link because it's a political website (satire on the Republican Party).
That is why we always use phony text in our examples.
Like this: http://www.imaginekitty.com/double-column.html

That way no one is offended and no one will argue with you as this is not the place for that (there are plenty of other places like that).

I am sure the anchors would work if you address them somewhere. How are you linking to them?

What happens when you go here:
http://www.republicandictionary.com/rd_a.shtml#affirmativeaction

Signed,

The helpful republican. Laughing out loud

istuartw
Offline
Regular
Last seen: 17 years 21 weeks ago
Joined: 2005-02-08
Posts: 13
Points: 0

I SOLVED IT!!

Sorry about the breach in protocol, Triumph, I've seen the "lorum ipsum whatever" enough to know better.

But I solved the problem - boy was it tricky.

The deal is, if you place anchors inside a div that is relatively positioned, for example -

position: relative;
top: -150px;

Then IE will go to the anchor, but it will load the page 150 pixels under the anchor!

The way I solved it was to convert the div in question to be absolute.

Thanks for the input!

Peace.