473,322 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 5884
/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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Tjerk Wolterink | last post by:
i have the following rule, <xsl:template match="br"> <br/> </xsl:template> This should convert all <br/> to <br/> but, my transformer transforms it all to
5
by: Greg N. | last post by:
Hi folks, I have a table cell with a background image, something like <td background=landscape.jpg height=200></td> The sole purpose of this code is to display the image inside that table...
39
by: fleemo17 | last post by:
I'm wondering whether it's better to leave an alt tag blank (alt=" ") or specify something like "alt='spacer'" when referring to objects that merely help the layout of the page? -Fleemo
5
by: Krechting | last post by:
Hi ALl, I have a code that checks if the documents in a hyperlink field are still where they should be. I use fileexist(). First I want to filter out all the hyperlink fields that are empty. I...
1
by: Shapper | last post by:
Hello, I have this code line inside an ASP.Net Repeater: <a href='<%# DataBinder.Eval(Container.DataItem, "link") %>'><%= readMore %></a> What I need to do is: 1. Show readMore value if <%#...
14
by: Xah Lee | last post by:
if i want to have a empty link, which way is more proper? <a href=""> <a href="#"> <a href="javascript:void(0);"> Xah xah@xahlee.org ∑ http://xahlee.org/
16
by: Lastwebpage | last post by:
Hello, I am little surprised about the following: <a href="#" ... I found some lines about the href tag for a site should point to an name or in XHTML to an ID, but in both cases this seems to...
1
by: Anilsg | last post by:
Hi all, I have the DropDownList in the FormView,inside InsertTemplateField The data is binded in run time to it in codebehind page,FOr the First time the page is loaded the DropdownList is...
0
by: Anilsg | last post by:
Hi all, I have the DropDownList in the FormView,inside InsertTemplateField The data is binded in run time to it in codebehind page,FOr the First time the page is loaded the DropdownList...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.