472,125 Members | 1,498 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,125 software developers and data experts.

Name attribute question

I have a few questions about the name attributes and href referencing
to. Can you declare name attributes for tags other than anchor
elements (like div or h2)? The validator keeps returning the following
error for HTML 4.0 strict .

Line 139, column 12: there is no attribute "NAME"

<h2 name="heading">H2 Headline </h2>

| You have used the attribute named above in your document, but the document type | you are using does not support that attribute for this element. This error is often
| caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

My goal is to create hot links to specific sections of the document.
This objective does not refer to documents outside the current
document covered by traditional anchor elements (href). One developer
suggested that you could replace the following.

<a name="heading"></a>

<h2 name="heading">H2 Headline </h2>

So I made the changes and discovered that these changes did not
validate. This discovery happens after sometime away from the document
in question. Upon revisiting the document, the errors left me
perplexed and at odds. A quick Google search only led me to
descriptions about traditional anchors and the name attributes. These
results did not mention name attributes in other elements. Maybe, I
did not remember the correct term for hot links within a document.
Does anybody have any links that explain what I call hot links? Does
this scenario only occur in HTML 4.0 (and not xHTML)? Please give a
brief description of this topic if appropriate.

Jul 21 '05 #1
5 5646
Neville310 wrote:

My goal is to create hot links to specific sections of the document.
This objective does not refer to documents outside the current
document covered by traditional anchor elements (href). One developer
suggested that you could replace the following.

<a name="heading"></a>
<h2 name="heading">H2 Headline </h2>

Use the "id" tag. The id value must be unique to validate.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 21 '05 #2
In message <ft********************************@4ax.com>, Neville310
<r0bert_neville@y.?.com.invalid> writes
I have a few questions about the name attributes and href referencing
to. Can you declare name attributes for tags other than anchor
elements (like div or h2)? The validator keeps returning the following
error for HTML 4.0 strict .

Line 139, column 12: there is no attribute "NAME"

<h2 name="heading">H2 Headline </h2>

| You have used the attribute named above in your document, but the
document type | you are using does not support that attribute for this
element. This error is often
| caused by incorrect use of the "Strict" document type with a document
that uses frames (e.g. you must use the "Transitional" document type to
get the "target" attribute), or by using vendor proprietary extensions
such as "marginheight" (this is usually fixed by using CSS to achieve
the desired effect instead).

My goal is to create hot links to specific sections of the document.
This objective does not refer to documents outside the current
document covered by traditional anchor elements (href). One developer
suggested that you could replace the following.

<a name="heading"></a>

<h2 name="heading">H2 Headline </h2>

So I made the changes and discovered that these changes did not
validate. This discovery happens after sometime away from the document
in question. Upon revisiting the document, the errors left me
perplexed and at odds. A quick Google search only led me to
descriptions about traditional anchors and the name attributes. These
results did not mention name attributes in other elements. Maybe, I
did not remember the correct term for hot links within a document.
Does anybody have any links that explain what I call hot links? Does
this scenario only occur in HTML 4.0 (and not xHTML)? Please give a
brief description of this topic if appropriate.


<div style="width:100%;">
<h2 id="lab0"><a name="lab0">INTRODUCTION.</a></h2>
</div>
--
Jake
(ja**@gododdin.demon.co.uk .... just a spam trap.)

Jul 21 '05 #3
jake wrote:
<h2 id="lab0"><a name="lab0">INTRODUCTION.</a></h2>


Have a look at the illegal example in
<http://www.w3.org/TR/html4/struct/links.html#h-12.2.3>

xpost and f'up2 ciwah
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 21 '05 #4
Jim Moe wrote:
Neville310 wrote:

My goal is to create hot links to specific sections of the document.
This objective does not refer to documents outside the current
document covered by traditional anchor elements (href). One developer
suggested that you could replace the following.

<a name="heading"></a>
<h2 name="heading">H2 Headline </h2>

Use the "id" tag. The id value must be unique to validate.

There's no such thing as an "id" tag. Have you ever seen <id> in an HTML
file?
Jul 21 '05 #5
Harlan Messinger wrote:

<a name="heading"></a>
<h2 name="heading">H2 Headline </h2>

Use the "id" tag. The id value must be unique to validate.

There's no such thing as an "id" tag. Have you ever seen <id> in an HTML
file?


<sigh>. Ya know, I had originally said "attribute" but then second
guessed myself by thinking about "tag soup" styling.
And mentioning that it is a attribute rather than a tag is more
informative than "Bzzt! Wrong!"

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Peter N. Schweitzer | last post: by
6 posts views Thread by Richard | last post: by
10 posts views Thread by Neville310 | last post: by
24 posts views Thread by Chameleon | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.