Bad? Or not? (But I think I already know...)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • The Plankmeister

    Bad? Or not? (But I think I already know...)

    Is doing this bad:

    <h3>Some title or other...<a href="#pagetop" >back to top</a></h3>

    I have a feeling it is... My problem is I'm using CSS to style the H3 into a
    block that spans the whole containing element. I would like the <a> to
    appear next to the title, but I'm sure this is bad practice (for screen
    readers and heading-level navigation etc etc)

    So... is it acceptable to do this:

    <span><h3>Som e title or other...</h3><a href="#pagetop" >back to
    top</a></span>

    Or does nesting the <h3> in a <span> do something horrible to the document
    structure?

    Comments, please! :)

    P.




  • Peter Foti

    #2
    Re: Bad? Or not? (But I think I already know...)

    "The Plankmeister" <plankmeister_N OSPAM_@hotmail. com> wrote in message
    news:3f8d923a$0 $45370$edfadb0f @dread11.news.t ele.dk...[color=blue]
    > Is doing this bad:
    >
    > <h3>Some title or other...<a href="#pagetop" >back to top</a></h3>
    >
    > I have a feeling it is... My problem is I'm using CSS to style the H3 into[/color]
    a[color=blue]
    > block that spans the whole containing element. I would like the <a> to
    > appear next to the title, but I'm sure this is bad practice (for screen
    > readers and heading-level navigation etc etc)
    >
    > So... is it acceptable to do this:
    >
    > <span><h3>Som e title or other...</h3><a href="#pagetop" >back to
    > top</a></span>[/color]

    I haven't confirmed this in the spec, but I think <h3> is NOT an inline
    element, so using span would be incorrect. A better solution might be:

    <div class="myheadin g3">
    <h3>Hello World</h3>
    <a href="#pagetop" class="toplink" >back to top</a>
    </div>

    Putting the <a> in the <h3> is most likely incorrect semantics.
    Hope this helps.
    Regards,
    Peter Foti


    Comment

    • Jim Dabell

      #3
      Re: Bad? Or not? (But I think I already know...)

      The Plankmeister wrote:
      [color=blue]
      > Is doing this bad:
      >
      > <h3>Some title or other...<a href="#pagetop" >back to top</a></h3>
      >
      > I have a feeling it is...[/color]

      I'd say so, as the 'back to top' text isn't part of the header.

      [color=blue]
      > My problem is I'm using CSS to style the H3 into a block that spans the
      > whole containing element. I would like the <a> to appear next to the
      > title, but I'm sure this is bad practice (for screen readers and
      > heading-level navigation etc etc)
      >
      > So... is it acceptable to do this:
      >
      > <span><h3>Som e title or other...</h3><a href="#pagetop" >back to
      > top</a></span>
      >
      > Or does nesting the <h3> in a <span> do something horrible to the document
      > structure?[/color]

      <span> elements cannot contain block-level elements, so you'd get a
      validation error immediately upon opening the <h3> element (with XHTML), or
      when you attempt to close the <span> element (with HTML).

      In practice, I wouldn't be surprised if you had difficulty styling things
      the way you want in some browsers, as the <h3> element wouldn't be within
      the <span> element as you intend.

      Use a <div> element in place of the <span> element, and you should be fine.
      An even better approach would be to pick a more suitable element, but
      without knowing the context, I can't suggest one (and there may not even be
      one).

      --
      Jim Dabell

      Comment

      • Samuël van Laere

        #4
        Re: Bad? Or not? (But I think I already know...)

        "The Plankmeister" <plankmeister_N OSPAM_@hotmail. com> schreef in bericht
        news:3f8d923a$0 $45370$edfadb0f @dread11.news.t ele.dk...[color=blue]
        > Is doing this bad:
        >
        > <h3>Some title or other...<a href="#pagetop" >back to top</a></h3>
        >
        > I have a feeling it is... My problem is I'm using CSS to style the H3 into[/color]
        a[color=blue]
        > block that spans the whole containing element. I would like the <a> to
        > appear next to the title, but I'm sure this is bad practice (for screen
        > readers and heading-level navigation etc etc)
        >
        > So... is it acceptable to do this:
        >
        > <span><h3>Som e title or other...</h3><a href="#pagetop" >back to
        > top</a></span>
        >
        > Or does nesting the <h3> in a <span> do something horrible to the document
        > structure?
        >
        > Comments, please! :)
        >
        > P.
        >[/color]

        <h3><span>Som e title or other...</span></h3>
        <a href="#pagetop" >back to top</a>

        Or is this not what you want?


        --
        With regards,
        Samuël van Laere
        the Netherlands




        Comment

        • Jukka K. Korpela

          #5
          Re: Bad? Or not? (But I think I already know...)

          Jim Dabell <jim-usenet@jimdabel l.com> wrote:
          [color=blue][color=green]
          >> Is doing this bad:
          >>
          >> <h3>Some title or other...<a href="#pagetop" >back to top</a></h3>
          >>
          >> I have a feeling it is...[/color]
          >
          > I'd say so, as the 'back to top' text isn't part of the header.[/color]

          That's true, structurally (and presentationall y it would result in
          displaying the link in heading style unless you specifically try to
          prevent that).

          But the main point, IMHO, is that the "back to top" links are worse
          than useless, irrespectively of markup and presentation issues:
          - they add nothing to the functionality, since they are just poor
          duplication of every browser's built-in function for getting to
          the top
          - they look real foolish on paper
          - they disturb the tabbing order, making it more awkward to move around
          links using the tab key
          - they pollute the list of links on a page (and this is relevant e.g.
          to blind user who navigates using a browser-constructed list of
          links on a page)
          - they are not unambiguous in meaning (top of _what_? site?)
          - they are misleading when the user has followed a link that leads to
          some anchor inside the document - going "back" would have different
          meaning then
          etc.

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

          Comment

          • Jonathan Snook

            #6
            Re: Bad? Or not? (But I think I already know...)

            "The Plankmeister" <plankmeister_N OSPAM_@hotmail. com> wrote in message
            news:3f8d923a$0 $45370$edfadb0f @dread11.news.t ele.dk...[color=blue]
            > Is doing this bad:
            >
            > <h3>Some title or other...<a href="#pagetop" >back to top</a></h3>[/color]

            How about removing the "back to top" altogether? Most user agents support a
            way to return to the top of the page with ease.

            Jonathan


            --



            Comment

            • Salagir

              #7
              Re: Bad? Or not? (But I think I already know...)

              On Wed, 15 Oct 2003 23:33:40 GMT, in comp.infosystem s.www.authoring.html,
              Jonathan Snook wrote:[color=blue][color=green]
              > > Is doing this bad:
              > > <h3>Some title or other...<a href="#pagetop" >back to top</a></h3>[/color]
              > How about removing the "back to top" altogether? Most user agents support a
              > way to return to the top of the page with ease.[/color]

              Yeah, did everyone forgot what the "home" key is for ?

              I've never understood theses website with links to places where we can
              easily go by ourselves: "back" links with a javascript:hist ory(-1),
              "top" links like this one, etc..

              (followup to authoring.html, no stylesheets here)
              --
              ++++++++ Zelda, Dragon Ball, Mana and my (art)work at www.salagir.com ++++++++
              Pas de violence, c'est les vacances !

              Comment

              • Matthias Gutfeldt

                #8
                Re: Bad? Or not? (But I think I already know...)

                Salagir wrote:[color=blue]
                > On Wed, 15 Oct 2003 23:33:40 GMT, in comp.infosystem s.www.authoring.html,
                > Jonathan Snook wrote:
                >[color=green][color=darkred]
                >>>Is doing this bad:
                >>><h3>Some title or other...<a href="#pagetop" >back to top</a></h3>[/color]
                >>
                >> How about removing the "back to top" altogether? Most user agents support a
                >> way to return to the top of the page with ease.[/color]
                >
                >
                > Yeah, did everyone forgot what the "home" key is for ?
                >
                > I've never understood theses website with links to places where we can
                > easily go by ourselves: "back" links with a javascript:hist ory(-1),
                > "top" links like this one, etc..[/color]

                Yeah, it's complete nonsense. Some clients can be convinced, but others
                simply say "it's more convenient" or "nobody knows how the browser
                works". Most of the time it's just THEM who don't know how the browser
                works and can't be bothered to learn how to operate their software. Oh well.


                Matthias

                Comment

                • Tina Holmboe

                  #9
                  Re: Bad? Or not? (But I think I already know...)

                  Salagir <Salagir@jeruCI TEDELESPACE.org .invalid> exclaimed in <3f8e545b$0$104 28$626a54ce@new s.free.fr>:
                  [color=blue]
                  > Yeah, did everyone forgot what the "home" key is for ?[/color]

                  You are, in other words, quite convinced that (a) all UAs have such
                  functionality, (b) the HOME key exist in all circumstances ?

                  --
                  - Tina Holmboe Greytower Technologies
                  tina@greytower. net http://www.greytower.net/
                  [+46] 0708 557 905

                  Comment

                  • Brian

                    #10
                    Re: Bad? Or not? (But I think I already know...)

                    Tina Holmboe wrote:[color=blue]
                    > Salagir <Salagir@jeruCI TEDELESPACE.org .invalid> exclaimed in
                    > <3f8e545b$0$104 28$626a54ce@new s.free.fr>:
                    >[color=green]
                    >> Yeah, did everyone forgot what the "home" key is for ?[/color]
                    >
                    > You are, in other words, quite convinced that (a) all UAs have such
                    > functionality,[/color]

                    Is there a ua that does not have the ability to go to the top of a page?

                    --
                    Brian
                    follow the directions in my address to email me

                    Comment

                    • Tina Holmboe

                      #11
                      Re: Bad? Or not? (But I think I already know...)

                      Brian <usenet1@mangym utt.com.invalid-remove-this-part> exclaimed in <Zkwjb.572172$c F.246247@rwcrns c53>:
                      [color=blue]
                      > Tina Holmboe wrote:[color=green]
                      >> Salagir <Salagir@jeruCI TEDELESPACE.org .invalid> exclaimed in
                      >> <3f8e545b$0$104 28$626a54ce@new s.free.fr>:
                      >>[color=darkred]
                      >>> Yeah, did everyone forgot what the "home" key is for ?[/color]
                      >>
                      >> You are, in other words, quite convinced that (a) all UAs have such
                      >> functionality,[/color]
                      >
                      > Is there a ua that does not have the ability to go to the top of a page?[/color]

                      Good question. I can find no such method on my T68i. Can we be certain
                      that ALL UAs have this function built in ?

                      Going back, or forward, in the browsing history - yes. Going to the start
                      of the document ? I don't know. It is difficult to say whether all
                      UAs in use have that function built in.

                      So perhaps we shouldn't dismiss the idea; it doesn't really do any
                      harm to anyone.

                      --
                      - Tina Holmboe Greytower Technologies
                      tina@greytower. net http://www.greytower.net/
                      [+46] 0708 557 905

                      Comment

                      • Brian

                        #12
                        Re: Bad? Or not? (But I think I already know...)

                        Tina Holmboe wrote:[color=blue]
                        > Brian <usenet1@mangym utt.com.invalid-remove-this-part> exclaimed in
                        > <Zkwjb.572172$c F.246247@rwcrns c53>:
                        >[color=green]
                        >> Is there a ua that does not have the ability to go to the top of
                        >> a page?[/color]
                        >
                        > Good question. I can find no such method on my T68i.[/color]

                        Wow. So, you load a page on the mobile phone, read the first few
                        lines, then scroll down. You get to the bottom. You want to read the
                        first few lines again, but you can't. The T68i does not permit you
                        any means to return to the top of the page. Is that actually correct?
                        That is one piss-poor browser they put in there.
                        [color=blue]
                        > Can we be certain that ALL UAs have this function built in ?[/color]

                        Perhaps all but Ericsson's.

                        --
                        Brian
                        follow the directions in my address to email me

                        Comment

                        • Philipp Lenssen

                          #13
                          Re: Bad? Or not? (But I think I already know...)

                          The Plankmeister wrote:
                          [color=blue]
                          > Is doing this bad:
                          >[/color]
                          [color=blue]
                          >
                          > <span><h3>Som e title or other...</h3><a href="#pagetop" >back to
                          > top</a></span>
                          >[/color]

                          "Back to top" links don't make sense in the context of HTML. They are
                          especially worse inside a heading, but that's just on top. So yes it's
                          sort of bad, if you care about HTML, accessibility, usability etc.

                          --
                          Google Blogoscoped
                          A daily news blog and community covering Google, search, and technology.

                          Comment

                          • Philipp Lenssen

                            #14
                            Re: Bad? Or not? (But I think I already know...)

                            Tina Holmboe wrote:
                            [color=blue]
                            >
                            > Good question. I can find no such method on my T68i. Can we be
                            > certain that ALL UAs have this function built in ?
                            >
                            > Going back, or forward, in the browsing history - yes. Going to the
                            > start of the document ? I don't know. It is difficult to say
                            > whether all UAs in use have that function built in.
                            >
                            > So perhaps we shouldn't dismiss the idea; it doesn't really do any
                            > harm to anyone.[/color]

                            Neither does "click here" do much harm. But just as "top of page" it's
                            just plain silly to include it in most circumstances, especially with
                            varying browser heights. Yucca pointed out some more.

                            --
                            Google Blogoscoped
                            A daily news blog and community covering Google, search, and technology.

                            Comment

                            • Alan J. Flavell

                              #15
                              Re: Bad? Or not? (But I think I already know...)

                              On Thu, 16 Oct 2003, Philipp Lenssen wrote:
                              [color=blue]
                              > Neither does "click here" do much harm. But just as "top of page" it's
                              > just plain silly to include it in most circumstances,[/color]

                              I perceive them (rightly or wrongly) as indicative of a patronising
                              attitude by the author. Personally, I don't like that. I like authors
                              who do me the courtesy of treating me as an equal, even if I rate to
                              learn something new from them: and I try to apply that approach myself
                              too. (Not that it always works out successfully, for sure, but that's
                              the plan.)

                              Perhaps it's just because I learned the principle of "don't mention
                              the mechanics"[1], and took it to heart.

                              The fact that such mechanical crutches can often be misguided in
                              detail is not the chief problem: they ought not to be there at all,
                              because there shouldn't be any need for them (if there is, that's a
                              browser shortcoming, not something which content authors ought to be
                              expected to remedy).

                              I say let the content stand on its own feet. I wouldn't want every
                              mushroom recipe, hillwalking guide, train spotter's photo gallery etc.
                              etc to turn into an alternative browser-use tutorial.

                              I suspect we agree on the general principles, even if we differ on
                              some points of detail, no?

                              cheers

                              [1] http://www.w3.org/Provider/Style/

                              Comment

                              Working...