空链接 [英] Empty link

查看:111
本文介绍了空链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为netscape.public.dev.css上线程[1]的一部分,一个人(Gus Richter)

试图说服我< a>< span>< / span> < / A>不是空锚:

As part of a thread [1] on netscape.public.dev.css a guy (Gus Richter)
tries to convince me <a><span></span></a> is not an empty anchor:

当然< p>< / p>是空的,在下面;
< div>< a href ="#">< span id =" header">< / span>< / a>< / div>
div有一个锚作为内容。
*锚具有内容*。 (您的错误争论是
< a>< span>< / span>< / a>是一个空锚。)
另一方面,跨度是空的,但是它确实有尺寸和背景图像。跨度空的事实在这个背景下是无关紧要的。
Of course the <p></p> is empty and in the following;
<div><a href="#"><span id="header"></span></a></div>
The div has an anchor as content.
*The anchor has span as content*. (Your erroneous contention is that
<a><span></span></a> is an empty anchor.)
The span, on the other hand, is empty, but it does have dimensions and a
background image. The fact that span is empty is inconsequential in this
context.




我认为他混合了很多内容和演示方法,但

似乎我无法向他解释(可能我的英语不是那么好)

或者我真的错了。有人可以进一步评论吗?


[1]将链接和光标添加到背景图像?

< http://groups.google .com / group / netscape.public.dev.css / browse_thread / thread / 93979de28eae0929 / 7ff9547dbe03d825#7ff9547dbe03d825>


-

Stanimir



I think he is mixing a lot the content and presentation means, but
seems I can''t explain it to him (probably my English is not such good)
or I''m truly wrong. Could anyone comment some further?

[1] "Add link and cursor to background image?"
<http://groups.google.com/group/netscape.public.dev.css/browse_thread/thread/93979de28eae0929/7ff9547dbe03d825#7ff9547dbe03d825>

--
Stanimir

推荐答案

/ Stanimir Stamenkov /:
/Stanimir Stamenkov/:
作为netscape.public上线程[1]的一部分.dev.css一个人(Gus Richter)
试图说服我< a>< span>< / span>< / a>不是空锚:


为了举出更具体的例子,我已说过:


< a>< img alt =链接文字 src =" ...">< / a>


不是空链接(Gus称之为OPs方法),但他说:

我相信你现在说的是我的方法有效,但如果关闭CSS则会失败。我完全同意。然而你指出OPs
方法是可以接受的,虽然它应该因为同样的原因而失败。


Gus,我相信你也读过这个小组,所以我会在这里回复你。


/ Gus Richter /:

此外,您没有注意到并指出他(正如您对我的原始示例所做的那样)他在每个页面开头覆盖透明
gif的方法是也无效。


不,这个方法并不是无效的,并且因为''alt''的内容而没有你的那么糟糕,但我指出了已经

< http://groups.google.com/group/netscape.public.dev.css/browse_thread/thread/93979de28eae0929/7ff9547dbe03d825#f2de07bb0346dc67>:

我建议在链接中添加一个标题(对于
样式表不可用的情况,需要将其添加到
< img>元素,因为IE错误)但透明的图像是 - 渲染
一个空白区域。
As part of a thread [1] on netscape.public.dev.css a guy (Gus Richter)
tries to convince me <a><span></span></a> is not an empty anchor:
To put more concrete examples, I''ve stated:

<a><img alt="Link text" src="..."></a>

is not an empty link (what Gus refers to as "OPs method"), but he says:
What I believe you are now saying is that my method works, but fails if
CSS is turned off. I totally agree with that. Yet you point out the OPs
method to be acceptable although it should fail for the same reason.
Gus, I believe you read this group also, so I''ll reply you here.

/Gus Richter/:
Additionally, you failed to note and point out to him (as you correctly
did for my original example) that his method of overlaying a transparent
gif at the start of each page is also invalid.
No, the method is not invalid and is not such bad as yours because of
the ''alt'' content, but I''ve pointed that already
<http://groups.google.com/group/netscape.public.dev.css/browse_thread/thread/93979de28eae0929/7ff9547dbe03d825#f2de07bb0346dc67>:
I suggest adding a ''title'' to the link (one would need to add it to
the <img> element because IE bug, again) for the case where the
stylesheet is not available but the transparent image is - rendering
an empty area.




-

Stanimir



--
Stanimir


Stanimir Stamenkov写道:
Stanimir Stamenkov wrote:

Gus,我相信你也读了这个小组,所以我会在这里回复你。

Gus, I believe you read this group also, so I''ll reply you here.




确实我这样做并允许我重新解释这个问题。


我们似乎要求就一个问题进行调解关于OP询问的
for:

"在每个页面上都有一个可链接的横幅图像的方法,

,但每页都没有编码IMG元素。


我的建议(经过验证)可在以下网址找到:

< http://www.home.golden.net/~richterf/Span/span-background.html>

横幅区域在示例中以边界为单位。较小的图像用于

显示整个边界区域是链接。


有问题的编码包括:

#header {display:block;

宽度:100%;

身高:100px;

背景:url(至横幅图片)不重复;}


< div>

< a href ="#">< span id = " header">< / span>< / a>

< / div>


Stanimir的论点是它是无效,因为Anchor中没有内容



我说它在两点上有效。

HTML后紧接着BODY和div(块)包含

锚点(内联)。

虽然没有特别要求Anchor必须具有

的内容(但是它只是有意义的)SPAN是Anchor的内容。


关于以下代码的另一个争论点

BODY(使用透明) nt image)as:


< a href =" /index.php">< img id =" banner" alt =""

src =" images / banner_background.gif" />< / a>


Stanimir说它是有效。

我说它无效。 Anchor(内联)应该在一个

块内部,例如div,因为它就在BODY之后。

另外,我说用XHTML,附录C是不正确的应用

和img元素部分应编码为:


< img id =" banner" ALT ="" SRC ="图像/ banner_background.gif" />

^^^


Stanimir,我有没有正确地压缩它?


-

Gus



Indeed I do and permit me to rephrase the issue.

It would seem that we are asking for mediation on an issue which is
regarding an OP asking for:
"A method to have a linkable banner image on every page,
but without the IMG element coded on every page."

My proposal (validated) can be found at:
<http://www.home.golden.net/~richterf/Span/span-background.html>
The banner area is bordered in the example. A smaller image is used to
show that the whole bordered area is the link.

The coding in question consists of:

#header{display:block;
width:100%;
height:100px;
background: url(to the banner image) no-repeat;}

<div>
<a href="#"><span id="header"></span></a>
</div>

Stanimir''s contention is that it is invalid because there is no content
in the Anchor.
I say that it is valid on two points.
The HTML follows immediately after BODY and div (block) contains the
Anchor (inline).
Although there is no specific requirement that an Anchor must have
content (but it only makes sense) SPAN is the content of the Anchor.

The other point of contention regarding the below code immediately after
BODY (using a transparent image) as:

<a href="/index.php"><img id="banner" alt=""
src="images/banner_background.gif "/></a>

Stanimir says that it is valid.
I say that it is not valid. That the Anchor (inline) should be inside a
block such as a div since it is immediately after BODY.
Additionally, I say that with XHTML, Appendix C is improperly applied
and the img element portion should be coded as:

<img id="banner" alt="" src="images/banner_background.gif" />
^^^

Stanimir, have I condensed it properly?

--
Gus


Gus Richter< gu ******** @ netscape.net>写道:
Gus Richter <gu********@netscape.net> wrote:
< div>
< a href ="#">< span id =" header">< / span> < / a>
< / div>

Stanimir的论点是它无效,因为Anchor中没有内容。


争论这些事情毫无意义。可以检查它是否有效。

是否有效。至于它是否为空,这取决于你是什么意思,因为它是空的;一旦你用HTML术语表达自己,

问题就会在一系列逻辑中解决。

我说它在两点上有效。


没有两点有效。

Stanimir说这是有效的。
我说它是无效。
<div>
<a href="#"><span id="header"></span></a>
</div>

Stanimir''s contention is that it is invalid because there is no content
in the Anchor.
It''s pointless to argue on such things. It can be checked whether it is
valid or not. As regards to whether it is empty, it depends on what you
mean by its being empty; as soon as you express yourself in HTML terms, the
problem resolves in a puff of logic.
I say that it is valid on two points.
There''s no such thing as being valid on two points.
Stanimir says that it is valid.
I say that it is not valid.




哦,拜托。如果你争论它,那么至少有一个人不知道

什么是有效的意味着。


无论是_useful_还是_appropriate_都是一个明智的问题,并且很好..... / b
b。但是通过询问

简单的问题来赢得辩论是非常容易的,并且当没有CSS时会发生什么?


- -

Yucca, http://www.cs .tut.fi / ~jkorpela /

关于网页制作的网页: http://www.cs.tut.fi/~jkorpela/www.html



Oh please. If you argue about it, then at least one of you does not know
what "valid" means.

Whether it is _useful_ or _appropriate_ is a sensible question, and nice
food for some debate. But it''s extremely easy to win the debate by asking a
simple question "and what happens when there is no CSS?"

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


这篇关于空链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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