468,136 Members | 1,454 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,136 developers. It's quick & easy.

Empty link

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:
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.


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

Aug 28 '05 #1
10 5652
/Stanimir Stamenkov/:
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

Aug 28 '05 #2
Stanimir Stamenkov wrote:

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


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
Aug 29 '05 #3
Gus Richter <gu********@netscape.net> wrote:
<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.


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

Aug 29 '05 #4
Jukka K. Korpela wrote:
It's pointless to argue on such things. It can be checked whether it is
valid or not.
Oh please. If you argue about it, then at least one of you does not know
what "valid" means.
It would seem that the Validator also does not know what "valid" means.
Please explain why Transitional validates.

Indeed it passes XHTML 1.0 Transitional validation:
<http://validator.w3.org/check?uri=http%3A%2F%2Fwww.isaca-lasvegas.org%2Findex.php>
Although Transitional, it should not have validated and should have
thrown the same first error as in Strict, IMHO.

It does *not* pass XHTML 1.0 Strict validation however:
<http://validator.w3.org/check?uri=http%3A%2F%2Fwww.isaca-lasvegas.org%2Findex.php&charset=%28detect+automat ically%29&doctype=XHTML+1.0+Strict>
where the first reported error is the one I was talking about, namely
that in HTML 4.01 only a block element may be the content of body.
The anchor, <a> element, being an inline element, is not a permitted
content of body. It is illegal and not valid markup, hence *invalid*
even though the validator stamped it as valid in Transitional. The
simple solution is to wrap it in a block like either a p or div.
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?"


That area has been covered.

--
Gus
Aug 29 '05 #5
Gus Richter wrote:
Oh please. If you argue about it, then at least one of you does not know
what "valid" means.
It would seem that the Validator also does not know what "valid" means.
Uh oh. Its a pretty mature bit of software. You might want to check the
quote at the top of its FAQ page.
Please explain why Transitional validates.
.... because its valid.

The body element may contain %Flow.
http://www.w3.org/TR/xhtml1/dtds.htm...0-Transitional
and %Flow includes #PCDATA.
http://www.w3.org/TR/xhtml1/dtds.htm...ional.dtd_Flow
Although Transitional, it should not have validated and should have
thrown the same first error as in Strict
In Strict, the body element may contain %Block
http://www.w3.org/TR/xhtml1/dtds.htm...TML-1.0-Strict
and %Block does not include #PCDATA
http://www.w3.org/TR/xhtml1/dtds.htm...rict.dtd_Block
IMHO.
You could propose to the W3C that their change the language to fit your
opinion of what it should be, but I doubt they'll comply.
namely that in HTML 4.01 only a block element may be the content of body.


That's HTML 4.01 Strict. HTML 4.01 Transitional is different.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Aug 29 '05 #6
On Mon, 29 Aug 2005, David Dorward revealed to more-selective
readers that:
Gus Richter wrote:
It would seem that the Validator also does not know what "valid"
means.


Evidently Gus Richter does not know what "valid" means. Further
discussion with him seems useless, unless/until he chooses to remedy
that defect.
Aug 29 '05 #7
/Gus Richter/:
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."
The thing was about not putting anything - using the stylesheet only,
but because UAs don't have good (pretty much no) support for generated
content we have to put something anyway, then let it be appropriate and
that's what our discussion is about - the appropriatenes of the "empty
link".
Stanimir's contention is that it is invalid because there is no content
in the Anchor.
I didn't say invalid - I've said it is bad in the means not
appropriate. I've used "invalid" only in my first reply regarding the
example you've given:

<a><div></div></a>
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.


It is valid in this context free form. The thing that it must be
contained in a block element to validate against HTML 4 Strict DTD is
another thing which we don't discuss, I think.

Aug 29 '05 #8
/Gus Richter/:
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."
The thing was about not putting anything - using the stylesheet only,
but because UAs don't have good (pretty much no) support for generated
content we have to put something anyway, then let it be appropriate and
that's what our discussion is about - the appropriateness of the "empty
link".
Stanimir's contention is that it is invalid because there is no content
in the Anchor.
I didn't say "invalid" - I've said it is bad in the means of not
appropriate. I've used "invalid" only in my first reply regarding the
example you've given:

<a><div></div></a>
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.


It is valid in this context free form. That it must be contained in a
block element in the document to validate against HTML 4 Strict DTD is
another thing which we don't discuss, but you've involved it, probably
misinterpreting my words "it's even worse" as "it is not valid". If you
notice, the examples I've previously given actually wrap the link in a
DIV element.

Note also my main point is about having image (although just
transparent) with _not_ empty 'alt' content.

--
Stanimir

Aug 29 '05 #9
David Dorward wrote:
Gus Richter wrote:

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


It would seem that the Validator also does not know what "valid" means.

Uh oh. Its a pretty mature bit of software. You might want to check the
quote at the top of its FAQ page.

Please explain why Transitional validates.

... because its valid.

The body element may contain %Flow.
http://www.w3.org/TR/xhtml1/dtds.htm...0-Transitional
and %Flow includes #PCDATA.
http://www.w3.org/TR/xhtml1/dtds.htm...ional.dtd_Flow

Although Transitional, it should not have validated and should have
thrown the same first error as in Strict

In Strict, the body element may contain %Block
http://www.w3.org/TR/xhtml1/dtds.htm...TML-1.0-Strict
and %Block does not include #PCDATA
http://www.w3.org/TR/xhtml1/dtds.htm...rict.dtd_Block

IMHO.

You could propose to the W3C that their change the language to fit your
opinion of what it should be, but I doubt they'll comply.

namely that in HTML 4.01 only a block element may be the content of body.

That's HTML 4.01 Strict. HTML 4.01 Transitional is different.


Thank you very, very much for taking the time. You have jogged my memory
regarding the DTD to which it validates.

To explain, if it is of any interest, the site was provided only 12
hours ago. Prior to that there was only a code segment provided by the
author. My mindset was on Strict. It took me by surprised when I saw
that the site was using Transitional and did not go to check the
Transitional DTD ...... my very bad.

Thank you for your courteous and helpful response.

--
Gus
Aug 29 '05 #10
In article <11**********************@f14g2000cwb.googlegroups .com>,
Stanimir Stamenkov <st****@gbg.bg> wrote:
/Gus Richter/:
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."


The thing was about not putting anything - using the stylesheet only,
but because UAs don't have good (pretty much no) support for generated
content we have to put something anyway, then let it be appropriate and
that's what our discussion is about - the appropriateness of the "empty
link".
Stanimir's contention is that it is invalid because there is no content
in the Anchor.


I didn't say "invalid" - I've said it is bad in the means of not
appropriate. I've used "invalid" only in my first reply regarding the
example you've given:

<a><div></div></a>
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.


It is valid in this context free form. That it must be contained in a
block element in the document to validate against HTML 4 Strict DTD is
another thing which we don't discuss, but you've involved it, probably
misinterpreting my words "it's even worse" as "it is not valid". If you
notice, the examples I've previously given actually wrap the link in a
DIV element.

Note also my main point is about having image (although just
transparent) with _not_ empty 'alt' content.


Hi

I'm the one who apparently started this.

I wound up recoding my pages to validate agains HTML 4.01 Strict
on the recommendations in this thread. This is my first website, so
I'm learning on the fly, so to speak. I wound up using

<div>
<a href="index.php">
<img id="banner" alt="Home Page Link" src="images/banner_background.gif "/>
</a>
<a name="Top">
</a>
</div>

as the first <div> on each page except for the home page and
everything seems to work as desired and the HTML 4.01 Strict
Validator is happy. Most of my pages are in the same directory,
but I added a relative path for those that are in subdirectories.
I still have a few extra spaces here and there in the code, courtesy
of my text mangler, but I'm gradually dealing with those as I see them.

Thanks all, for the help

Claude

Aug 30 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by Tjerk Wolterink | last post: by
5 posts views Thread by Greg N. | last post: by
39 posts views Thread by fleemo17 | last post: by
5 posts views Thread by Krechting | last post: by
1 post views Thread by Shapper | last post: by
14 posts views Thread by Xah Lee | last post: by
27 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.