锚的名称属性不验证 [英] Name attribute for anchor doesn't validate

查看:51
本文介绍了锚的名称属性不验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份包含一系列内部链接的文件,例如:


< a name =" Z1">< / a> ...

< a name =" Z2">< / a> ...

W3C验证程序对象名称属性的第一个实例:

没有属性FOO对于这个元素(在这个HTML

版本中)。该元素被定义为不具有此属性。


这些锚点不包含在任何内容中。例如,Z1

锚定背景实际上是:


...

< / ul>

< hr />

< a name =" Z1">< / a>

< h2> Title< / h2> ;

< dl>

...


错误仅由名称的第一个实例触发/>
属性,所以不是由锚点Z2,Z3,......


我的doctype是xhtml11,我的浏览器是galeon。在我的样式表中,

a元素仅根据其伪元素定义。


如果我将第一个语句更改为:


< a id =" Z1">< / a> ...


然后错误由Z2锚点等触发。


-

海恩斯·布朗
br ****@hartford-hwp.com
kb****@arrl.net
www.hartford-hwp.com

I have a document with a set of internal links such as:

<a name="Z1"></a>...
<a name="Z2"></a>...

The W3C validator objects to the first instance of the name attribute:
There is no attribute "FOO" for this element (in this HTML
version). The element is defined not to have this attribute.

These anchors are not contained in anything. For example, the Z1
anchor context is actually:

...
</ul>
<hr />
<a name="Z1"></a>
<h2>Title</h2>
<dl>
...

The error is triggered only by the first instance of the name
attribute, and so not by anchors Z2, Z3, ...

My doctype is xhtml11, and my browser is galeon. In my stylesheet,
the a element is defined only with regard to its pseudo-elements.

If I change the first statement to:

<a id="Z1"></a>...

Then the error is triggered by the Z2 anchor, etc.

--
Haines Brown
br****@hartford-hwp.com
kb****@arrl.net
www.hartford-hwp.com

推荐答案

Haines Brown:
Haines Brown:
我有一个包含一系列内部链接的文档,例如:
< ; a name =" Z1">< / a> ...
< a name =" Z2">< / a> ...

W3C验证器对象指向name属性的第一个实例:
没有属性FOO。对于此元素(在此HTML
版本中)。该元素定义为不具有此属性。


这是真的。所以删除名称属性。

我的doctype是xhtml11,我的浏览器是galeon。在我的样式表中,a元素仅根据其伪元素定义。
如果我将第一个语句更改为:

< a id =" Z1">< / a> ...
然后错误由Z2锚点等
I have a document with a set of internal links such as: <a name="Z1"></a>...
<a name="Z2"></a>...

The W3C validator objects to the first instance of the name attribute:
There is no attribute "FOO" for this element (in this HTML
version). The element is defined not to have this attribute.
That''s true. So remove the "name" attribute.
My doctype is xhtml11, and my browser is galeon. In my stylesheet,
the a element is defined only with regard to its pseudo-elements. If I change the first statement to:

<a id="Z1"></a>... Then the error is triggered by the Z2 anchor, etc.




将所有这些更改为id。没有名称属性为XHTML 1.1中的a

元素。


-

Bertilo Wennergren< be **** **@gmx.net> < http://www.bertilow.com>



Change all of them to "id". There is no "name" attribute for "a"
elements in XHTML 1.1.

--
Bertilo Wennergren <be******@gmx.net> <http://www.bertilow.com>


Haines Brown写道:
Haines Brown wrote:
我有一个具有一组内部链接的文档,例如:

< a name =" Z1">< / a> ...
< a name =" Z2" >< / a> ...


哦,旧式。

W3C验证器对象名称属性的第一个实例:版本中)。该元素定义为不具有此属性。


在XHTML 1.1中删除了锚点的name属性

这些锚点不包含在任何内容中。


这是无关紧要的。

错误仅由名称
属性的第一个实例触发,因此锚点Z2不会触发,Z3,...


这是为了清晰。不显示重复的错误。 (取决于

情况)

我的doctype是xhtml11,我的浏览器是galeon。


讨论验证时浏览器是无关紧要的。

在我的样式表中,a元素仅根据其
伪元素定义。


仍然无关紧要。

如果我将第一个陈述更改为:

< a id =" Z1"> < / a> ...

然后错误由Z2锚点等触发。
I have a document with a set of internal links such as:

<a name="Z1"></a>...
<a name="Z2"></a>...
Oooh, old style.
The W3C validator objects to the first instance of the name attribute:
There is no attribute "FOO" for this element (in this HTML
version). The element is defined not to have this attribute.
The name attribute for anchors was removed in XHTML 1.1
These anchors are not contained in anything.
That''s irrelevent.
The error is triggered only by the first instance of the name
attribute, and so not by anchors Z2, Z3, ...
That''s for clarity. Duplicate errors are not displayed. (Depending on the
circumstances)
My doctype is xhtml11, and my browser is galeon.
The browser is irrelevent when discussing validation.
In my stylesheet, the a element is defined only with regard to its
pseudo-elements.
Still irrelevent.
If I change the first statement to:

<a id="Z1"></a>...

Then the error is triggered by the Z2 anchor, etc.




当然,它仍然是错误。


您可能想要:< h2 id =" Z1">标题< / h2>


Netscape 4和其他固定浏览器不支持它,如果你关心

他们回到XHTML 1.0 ......或HTML 4.01。


-

David Dorward http://dorward.me.uk/ br />


Bertilo Wennergren< be ****** @ gmx.net>写道:
Bertilo Wennergren <be******@gmx.net> writes:
Haines Brown:
Haines Brown:
我有一个包含一系列内部链接的文档,例如:
I have a document with a set of internal links such as:


< a name =" Z1">< / a> ...
< a name =" Z2">< / a> ...
W3C验证器对象名称的第一个实例
属性:
没有属性FOO。对于此元素(在此HTML
版本中)。该元素被定义为不具有此属性。
<a name="Z1"></a>...
<a name="Z2"></a>...
The W3C validator objects to the first instance of the name
attribute:
There is no attribute "FOO" for this element (in this HTML
version). The element is defined not to have this attribute.



这是真的。所以删除名称属性。



That''s true. So remove the "name" attribute.




Bertilo。有趣。我看到了我的方式的错误。我用作

参考,Ian Graham的XHTML 1.0,显然名字属性

在XHTML 1.0中是可以的,甚至是首选的,因为旧的支持/>
浏览器。


我推断在XHTML 1.1中,name属性不再有效且不应使用
,即使一些旧的浏览器将不再使用
了解小数链接。


那么,你会推荐什么作为XHTML的良好硬拷贝参考

_1.1_?


-

海恩斯·布朗
br **** @ hartford-hwp.com
kb****@arrl.net
www.hartford-hwp.com



Bertilo. Interesting. I see the error of my ways. I use as a
reference, Ian Graham''s XHTML 1.0, and apparently the name attribute
was OK in XHTML 1.0, and even preferred because supported by older
browsers.

I infer that in XHTML 1.1, the name attribute is no longer valid and
should not be used, even though some older browsers will no longer
understand fractional links.

So, what would you recommend as a good hard copy reference for XHTML
_1.1_?

--
Haines Brown
br****@hartford-hwp.com
kb****@arrl.net
www.hartford-hwp.com


这篇关于锚的名称属性不验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆