The usual way to create an anchor is with the a element, but I read you can use the id name of any other element to create an anchor. I’m using the h2 id name as an anchor. This seems to work fine in IE6 but will not work in Firefox. Anyone know anything about this?
@WebJoelJan 19.2008 — #Do you mean like id="body" and class="html"? -Sounds untenable to me. Aren't certain 'words' considered to be "reserved words" and expected only for naming elements? Maybe not, you could have a class="p" and not have it mean "<p>" as it's the delimiters "<" and ">" (and " />") that make it a [U]tag[/U].. but when you begin having problems making this work, do tell. ?
Elements, and their 'id' and their 'class', really should be named [U]semantically[/U], -call them what they ARE or what they DO. -Save yourself from the mania of a convoluted and overly-complicated layout.
I can see it now... code" <div id="a26449-ad3" class="b-129964 c-a29984-24 dd-a123-6658"> followed with request: "it works in IE but not Firefox"... :mad:
Well maybe it [I]should[/I] work but who is going to want to explore this and fix it? :rolleyes: (whistling to self and walking towards door...) Or am I misunderstanding the question entirely? ?
Like I said, not the typical way of doing it, but here it is in my Elizabether Castro book...says you can use id names of elements as anchors. This works in IE6 but not firefox.
Sorry I wasn't clearer about the issue. What I ended up doing, because the h2 element was in the right spot for the anchor, was this...
<a name="bob></a><h2>Heading</h2>
<a href="#bob">Go see Bob</a>
Not the best semantically, but the best solution I could come up with.
@Major_PayneJan 21.2008 — #Don't think anyone said you couldn't use "id" or "name" for anchor names. That's brought out in the links posted. Second link just shows you right/wrong ways of using either.