Jump to content
Ian Hird

HTML5 - Which aspects are browser dependent?

Recommended Posts

Dear all,

 

I have just started using HTML5.

 

I tried coding

 

<article>

<a id="top"></a>

etc

</article>

 

to set an anchor point so that I could jump to the top of the current page.

This appeared to work when using Firefox but not when using IE9

 

I then tried

 

<article><section>

<a id="top"></a>

etc

</section>

</article>

 

This appeared to work with both Firefox and IE9.

 

Is this just a quirk of IE or must anchors always be in a section element?

 

Does anyone know of a central source where I can find other HTML5 aspects that only work with certain browsers

 

Thanks for any advice you can give me.

 

Ian

Share this post


Link to post
Share on other sites

Anchors should work regardless of which version of HTML you're using or which browser it's running on. I'd recommend putting the id on an element that actually means something, like an <h1> tag, or the <body> element if you want to jump to the top of the page. There's no point in adding an extra element to the document when so many others could use the ID attribute.

 

I can't reproduce the problem you're describing. I've tested all the way down to Internet Explorer 7 and <article><a id="top"></a></article> doesn't prevent the hash from working.

Share this post


Link to post
Share on other sites

To Foxy Mod

 

Thanks for your help.

 

I have tried it again and without the <section> it does not jump to the top of page anchor.

 

The problem may rest with the environment that I am running in or the CSS or something else. I will do some further investigations this weekend and see if I can track it down. If I gain any further insight I will post details.

 

Hope I haven't taken too much of your time.

 

Ian

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...