Jump to content

HTML5 - Which aspects are browser dependent?


Ian Hird

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

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...