Empty link

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • stanio@gbg.bg

    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:
    [color=blue]
    > 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.[/color]

    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.c om/group/netscape.public .dev.css/browse_thread/thread/93979de28eae092 9/7ff9547dbe03d82 5#7ff9547dbe03d 825>

    --
    Stanimir

  • Stanimir Stamenkov

    #2
    Re: Empty link

    /Stanimir Stamenkov/:
    [color=blue]
    > 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:[/color]

    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:
    [color=blue]
    > 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.[/color]

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

    /Gus Richter/:
    [color=blue]
    > 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.[/color]

    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.c om/group/netscape.public .dev.css/browse_thread/thread/93979de28eae092 9/7ff9547dbe03d82 5#f2de07bb0346d c67>:
    [color=blue]
    > 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.[/color]

    --
    Stanimir

    Comment

    • Gus Richter

      #3
      Re: Empty link

      Stanimir Stamenkov wrote:[color=blue]
      >
      > Gus, I believe you read this group also, so I'll reply you here.[/color]

      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_backgrou nd.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_backgrou nd.gif" />
      ^^^

      Stanimir, have I condensed it properly?

      --
      Gus

      Comment

      • Jukka K. Korpela

        #4
        Re: Empty link

        Gus Richter <gusrichter@net scape.net> wrote:
        [color=blue]
        > <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.[/color]

        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.
        [color=blue]
        > I say that it is valid on two points.[/color]

        There's no such thing as being valid on two points.
        [color=blue]
        > Stanimir says that it is valid.
        > I say that it is not valid.[/color]

        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

        Comment

        • Gus Richter

          #5
          Re: Empty link

          Jukka K. Korpela wrote:
          [color=blue]
          > 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.[/color]

          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.or g/check?uri=http% 3A%2F%2Fwww.isa ca-lasvegas.org%2F index.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.or g/check?uri=http% 3A%2F%2Fwww.isa ca-lasvegas.org%2F index.php&chars et=%28detect+au tomatically%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.
          [color=blue]
          > 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?"[/color]

          That area has been covered.

          --
          Gus

          Comment

          • David Dorward

            #6
            Re: Empty link

            Gus Richter wrote:
            [color=blue][color=green]
            >> Oh please. If you argue about it, then at least one of you does not know
            >> what "valid" means.[/color][/color]
            [color=blue]
            > It would seem that the Validator also does not know what "valid" means.[/color]

            Uh oh. Its a pretty mature bit of software. You might want to check the
            quote at the top of its FAQ page.
            [color=blue]
            > Please explain why Transitional validates.[/color]

            .... because its valid.

            The body element may contain %Flow.

            and %Flow includes #PCDATA.

            [color=blue]
            > Although Transitional, it should not have validated and should have
            > thrown the same first error as in Strict[/color]

            In Strict, the body element may contain %Block

            and %Block does not include #PCDATA

            [color=blue]
            > IMHO.[/color]

            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.
            [color=blue]
            > namely that in HTML 4.01 only a block element may be the content of body.[/color]

            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

            Comment

            • Alan J. Flavell

              #7
              Re: Empty link

              On Mon, 29 Aug 2005, David Dorward revealed to more-selective
              readers that:
              [color=blue]
              > Gus Richter wrote:
              >[color=green]
              > > It would seem that the Validator also does not know what "valid"
              > > means.[/color][/color]

              Evidently Gus Richter does not know what "valid" means. Further
              discussion with him seems useless, unless/until he chooses to remedy
              that defect.

              Comment

              • Stanimir Stamenkov

                #8
                Re: Empty link

                /Gus Richter/:
                [color=blue]
                > 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."[/color]

                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".
                [color=blue]
                > Stanimir's contention is that it is invalid because there is no content
                > in the Anchor.[/color]

                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>
                [color=blue]
                > 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_backgrou nd.gif "/></a>
                >
                > Stanimir says that it is valid.[/color]

                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.

                Comment

                • Stanimir Stamenkov

                  #9
                  Re: Empty link

                  /Gus Richter/:
                  [color=blue]
                  > 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."[/color]

                  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".
                  [color=blue]
                  > Stanimir's contention is that it is invalid because there is no content
                  > in the Anchor.[/color]

                  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>
                  [color=blue]
                  > 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_backgrou nd.gif "/></a>
                  >
                  > Stanimir says that it is valid.[/color]

                  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

                  Comment

                  • Gus Richter

                    #10
                    Re: Empty link

                    David Dorward wrote:[color=blue]
                    > Gus Richter wrote:
                    >
                    >[color=green][color=darkred]
                    >>>Oh please. If you argue about it, then at least one of you does not know
                    >>>what "valid" means.[/color][/color]
                    >
                    >[color=green]
                    >>It would seem that the Validator also does not know what "valid" means.[/color]
                    >
                    >
                    > Uh oh. Its a pretty mature bit of software. You might want to check the
                    > quote at the top of its FAQ page.
                    >
                    >[color=green]
                    >>Please explain why Transitional validates.[/color]
                    >
                    >
                    > ... 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
                    >
                    >[color=green]
                    >>Although Transitional, it should not have validated and should have
                    >>thrown the same first error as in Strict[/color]
                    >
                    >
                    > 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
                    >
                    >[color=green]
                    >>IMHO.[/color]
                    >
                    >
                    > 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.
                    >
                    >[color=green]
                    >>namely that in HTML 4.01 only a block element may be the content of body.[/color]
                    >
                    >
                    > That's HTML 4.01 Strict. HTML 4.01 Transitional is different.
                    >[/color]

                    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

                    Comment

                    • claudel

                      #11
                      Re: Empty link

                      In article <1125335816.347 032.178700@f14g 2000cwb.googleg roups.com>,
                      Stanimir Stamenkov <stanio@gbg.b g> wrote:[color=blue]
                      >/Gus Richter/:
                      >[color=green]
                      >> 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."[/color]
                      >
                      >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".
                      >[color=green]
                      >> Stanimir's contention is that it is invalid because there is no content
                      >> in the Anchor.[/color]
                      >
                      >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>
                      >[color=green]
                      >> 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_backgrou nd.gif "/></a>
                      >>
                      >> Stanimir says that it is valid.[/color]
                      >
                      >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
                      >misinterpretin g 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.
                      >[/color]

                      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_backgrou nd.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

                      Comment

                      Working...