Jump to content

linking to a named anchor


Brendon Branigin

Recommended Posts

<a href="resources.htm#habitat">visit habitat</a>

you would also have to put name="habitat" somewhere on your resources page (not the top or you wont see the effect)

Link to comment
Share on other sites

<a href="resources.htm#habitat">visit habitat</a>

you would also have to put name="habitat" somewhere on your resources page (not the top or you wont see the effect)

I thought the right way was always id="habitat", it still works the same though.
Link to comment
Share on other sites

erm, yeah Rah is right you should use id, but see quotes below, both should be used in meantime.XHTML

The id Attribute Replaces The name Attribute
Note: To interoperate with older browsers for a while, you should use both name and id, with identical attribute values
Link to comment
Share on other sites

Found it! Here we go:

"Note that in XHTML 1.0, the name attribute of these elements is formally deprecated, and will be removed in a subsequent version of XHTML."
http://www.w3.org/TR/xhtml1/#h-4.10http://www.w3.org/TR/xhtml1/#C_8:)Edit: Yup, scott is right, you should mean while use both of them together.
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...