XHTML Strict - using target inside <a>

Discussion in 'HTML' started by Dave Winter, Apr 7, 2004.

  1. Dave Winter

    Dave Winter Guest

    Hi all,

    I'm just starting out to convert my web site to XHTML.

    I use:

    <a href="website.html" target="_blank">Test</a>

    I use that a lot - and I was shocked to see when I validated my web
    site against the Strict DTD it said that the target tribute was invalid.

    I understand that it can be used with regards to frames, but not with
    opening links in new windows.

    Is there something I should be using instead?

    Really appreciate any help that can be given.

    Thanks.

    Dave.
     
    Dave Winter, Apr 7, 2004
    #1
    1. Advertising

  2. Dave Winter

    brucie Guest

    in post: <news:2004040715424616807%davewinter@maccom>
    Dave Winter <> said:

    > I'm just starting out to convert my web site to XHTML.


    why?

    > <a href="website.html" target="_blank">Test</a>
    > I use that a lot


    if your visitors want a new window/tab they can do it themselves.

    > and I was shocked to see when I validated my web site against the
    > Strict DTD it said that the target tribute was invalid.


    correct

    > Is there something I should be using instead?


    1. ignore the error
    2. modify the DTD
    3. change the DTD
    4. scripting (not recommended)
    5. let your visitors open new windows/tabs (recommended)

    --
    b r u c i e
     
    brucie, Apr 7, 2004
    #2
    1. Advertising

  3. Dave Winter

    Steve Pugh Guest

    Dave Winter <> wrote:

    >I'm just starting out to convert my web site to XHTML.


    Any particular reason?

    ><a href="website.html" target="_blank">Test</a>
    >
    >I use that a lot - and I was shocked to see when I validated my web
    >site against the Strict DTD it said that the target tribute was invalid.


    This has been the case since HTML 4 was released in 1997. So I guess
    that you're jumping straight from HTML 4 Transitional to XHTML 1
    Strict.

    >I understand that it can be used with regards to frames, but not with
    >opening links in new windows.


    Frames, windows, same thing - they're media specific and nothing to do
    with marking up data, which is what the Strict versions of HTML 4 and
    XHTML 1 are all about.

    >Is there something I should be using instead?


    1. Don't try to force new windows on your users, let them choose when
    to open a link in a new window or tab.
    2. Use a Transitional version instead.
    3. Use JavaScript, but be sure to write it in such a way that the link
    still works when JS isn't enabled.
    4. Ignore validation. Valid code is good but it is only a means to an
    end not a goal in itself.

    Why do you want you code to validate as XHTML 1.0 Strict?

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Apr 7, 2004
    #3
  4. Dave Winter

    Joshua Beall Guest

    "Steve Pugh" <> wrote in message
    news:...
    > ><a href="website.html" target="_blank">Test</a>
    > >
    > >I use that a lot - and I was shocked to see when I validated my web
    > >site against the Strict DTD it said that the target tribute was invalid.

    >
    > This has been the case since HTML 4 was released in 1997. So I guess
    > that you're jumping straight from HTML 4 Transitional to XHTML 1
    > Strict.


    Do I correctly interpret this as meaning that there is no valid way to cause
    a link to open in a new browser, unless you are using HTML4 Transitional?

    Aside from JS solutions. I try to avoid JS when possible though.
     
    Joshua Beall, Apr 7, 2004
    #4
  5. Dave Winter

    Steve Pugh Guest

    "Joshua Beall" <> wrote:

    >"Steve Pugh" <> wrote in message
    >news:...
    >> ><a href="website.html" target="_blank">Test</a>
    >> >
    >> >I use that a lot - and I was shocked to see when I validated my web
    >> >site against the Strict DTD it said that the target tribute was invalid.

    >>
    >> This has been the case since HTML 4 was released in 1997. So I guess
    >> that you're jumping straight from HTML 4 Transitional to XHTML 1
    >> Strict.

    >
    >Do I correctly interpret this as meaning that there is no valid way to cause
    >a link to open in a new browser, unless you are using HTML4 Transitional?


    No, you can use XHTML 1.0 Transitional.

    Steve



    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Apr 7, 2004
    #5
  6. Joshua Beall <> wrote:

    > "Steve Pugh" <> wrote in message
    > news:...
    >> ><a href="website.html" target="_blank">Test</a>
    >> >
    >> >I use that a lot - and I was shocked to see when I validated my
    >> >web site against the Strict DTD it said that the target tribute
    >> >was invalid.

    >>
    >> This has been the case since HTML 4 was released in 1997. So I
    >> guess that you're jumping straight from HTML 4 Transitional to
    >> XHTML 1 Strict.

    >
    > Do I correctly interpret this as meaning that there is no valid
    > way to cause a link to open in a new browser, unless you are using
    > HTML4 Transitional?


    You could use any DTD that has the target attribute in it.

    --
    David Håsäther
     
    David Håsäther, Apr 7, 2004
    #6
  7. Dave Winter

    Dave Winter Guest

    On 2004-04-07 16:01:26 +0100, Steve Pugh <> said:

    > Dave Winter <> wrote:
    >
    >> I'm just starting out to convert my web site to XHTML.

    >
    > Any particular reason?
    >> <a href="website.html" target="_blank">Test</a>
    >>
    >> I use that a lot - and I was shocked to see when I validated my web
    >> site against the Strict DTD it said that the target tribute was invalid.

    >
    > This has been the case since HTML 4 was released in 1997. So I guess
    > that you're jumping straight from HTML 4 Transitional to XHTML 1
    > Strict.
    >> I understand that it can be used with regards to frames, but not with
    >> opening links in new windows.

    >
    > Frames, windows, same thing - they're media specific and nothing to do
    > with marking up data, which is what the Strict versions of HTML 4 and
    > XHTML 1 are all about.
    >
    >> Is there something I should be using instead?

    >
    > 1. Don't try to force new windows on your users, let them choose when
    > to open a link in a new window or tab.
    > 2. Use a Transitional version instead.
    > 3. Use JavaScript, but be sure to write it in such a way that the link
    > still works when JS isn't enabled.
    > 4. Ignore validation. Valid code is good but it is only a means to an
    > end not a goal in itself.
    >
    > Why do you want you code to validate as XHTML 1.0 Strict?
    > Steve


    There's no real reason why, I'm just looking into how easy it would be
    to convert it to XHTML.

    From what I've seen of XHTML code, it's so much tidier. This is
    probably the main reason for me.

    And I like the point you make about not forcing new windows to open.

    I'll make a new post in a few minutes asking about converting my site
    from <table> to <div>
     
    Dave Winter, Apr 7, 2004
    #7
  8. Dave Winter

    Joshua Beall Guest

    "Steve Pugh" <> wrote in message
    news:...
    > >Do I correctly interpret this as meaning that there is no valid way to

    cause
    > >a link to open in a new browser, unless you are using HTML4 Transitional?

    >
    > No, you can use XHTML 1.0 Transitional.


    Oops, phrased my question wrong: there is no valid to cause a link to open
    in a new browser, if you are using an XHTML1.0/1.1 Strict doctype?
     
    Joshua Beall, Apr 7, 2004
    #8
  9. Joshua Beall wrote:

    > Oops, phrased my question wrong: there is no valid to cause a link to open
    > in a new browser, if you are using an XHTML1.0/1.1 Strict doctype?


    XHTML 1.0 Strict - no
    XHTML 1.1 - no
    XHTML 1.1 Strict - no such thing
    XHTML 1.1 with a frames module of some description[1] - yes

    [1] I'm being vague here because I haven't been inclined to use any modules
    with XHTML 1.1 so its somewhat outside my experience.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
     
    David Dorward, Apr 7, 2004
    #9
  10. On Thu, 08 Apr 2004 00:54:49 +1000, brucie wrote:

    > in post: <news:2004040715424616807%davewinter@maccom>
    > Dave Winter <> said:
    >
    >> I'm just starting out to convert my web site to XHTML.

    >
    > why?


    Why not?
     
    Brendan Taylor, Apr 7, 2004
    #10
  11. Dave Winter

    Dave Winter Guest

    On 2004-04-07 20:35:25 +0100, Brendan Taylor
    <> said:

    > On Thu, 08 Apr 2004 00:54:49 +1000, brucie wrote:
    >
    >> in post: <news:2004040715424616807%davewinter@maccom>
    >> Dave Winter <> said:
    >>
    >>> I'm just starting out to convert my web site to XHTML.

    >>
    >> why?

    >
    > Why not?


    Exactly what I was wondering.
     
    Dave Winter, Apr 7, 2004
    #11
  12. Dave Winter

    Mitja Guest

    "Brendan Taylor" <> wrote in message
    news:1KYcc.42596$Pk3.3608@pd7tw1no...
    > On Thu, 08 Apr 2004 00:54:49 +1000, brucie wrote:
    >
    > > in post: <news:2004040715424616807%davewinter@maccom>
    > > Dave Winter <> said:
    > >
    > >> I'm just starting out to convert my web site to XHTML.

    > >
    > > why?

    >
    > Why not?


    it takes time and achieves nothing compared to HTML 4.01 Strict.
     
    Mitja, Apr 7, 2004
    #12
  13. Dave Winter

    Mitja Guest

    "Dave Winter" <> wrote in message
    news:2004040716473916807%davewinter@maccom...
    > On 2004-04-07 16:01:26 +0100, Steve Pugh <> said:
    >
    > > Dave Winter <> wrote:
    > >
    > >> I'm just starting out to convert my web site to XHTML.

    > >
    > > Any particular reason?
    > >> <a href="website.html" target="_blank">Test</a>
    > >>
    > >> I use that a lot - and I was shocked to see when I validated my web
    > >> site against the Strict DTD it said that the target tribute was

    invalid.
    > >
    > > This has been the case since HTML 4 was released in 1997. So I guess
    > > that you're jumping straight from HTML 4 Transitional to XHTML 1
    > > Strict.
    > >> I understand that it can be used with regards to frames, but not with
    > >> opening links in new windows.

    > >
    > > Frames, windows, same thing - they're media specific and nothing to do
    > > with marking up data, which is what the Strict versions of HTML 4 and
    > > XHTML 1 are all about.
    > >
    > >> Is there something I should be using instead?

    > >
    > > 1. Don't try to force new windows on your users, let them choose when
    > > to open a link in a new window or tab.
    > > 2. Use a Transitional version instead.
    > > 3. Use JavaScript, but be sure to write it in such a way that the link
    > > still works when JS isn't enabled.
    > > 4. Ignore validation. Valid code is good but it is only a means to an
    > > end not a goal in itself.
    > >
    > > Why do you want you code to validate as XHTML 1.0 Strict?
    > > Steve

    >
    > There's no real reason why, I'm just looking into how easy it would be
    > to convert it to XHTML.
    >
    > From what I've seen of XHTML code, it's so much tidier. This is
    > probably the main reason for me.


    It's just that it enforces at least a kind of tidiness, but it can be
    achieved just as well with HTML. It's mainly a matter of consistently
    closing tags that are only optionally closed and _indenting_ everything.

    >
    > And I like the point you make about not forcing new windows to open.
    >
    > I'll make a new post in a few minutes asking about converting my site
    > from <table> to <div>
    >
     
    Mitja, Apr 7, 2004
    #13
  14. Dave Winter

    brucie Guest

    in post: <news:1KYcc.42596$Pk3.3608@pd7tw1no>
    Brendan Taylor <> said:

    >>> I'm just starting out to convert my web site to XHTML.


    >> why?


    > Why not?


    the appendix c paradox. i really don't see the point of authoring HTML
    thats pretending to be XHTML pretending to be HTML.

    --
    b r u c i e
     
    brucie, Apr 7, 2004
    #14
  15. Dave Winter

    DU Guest

    Dave Winter wrote:
    > Hi all,
    >
    > I'm just starting out to convert my web site to XHTML.
    >
    > I use:
    >
    > <a href="website.html" target="_blank">Test</a>
    >
    > I use that a lot - and I was shocked to see when I validated my web site
    > against the Strict DTD it said that the target tribute was invalid.
    >
    > I understand that it can be used with regards to frames, but not with
    > opening links in new windows.
    >
    > Is there something I should be using instead?
    >
    > Really appreciate any help that can be given.
    >
    > Thanks.
    >
    > Dave.
    >


    <a href="website.html" target="_blank">Test</a>

    I strongly discourage this way of coding links in documents whatever the
    DTD, strict or transitional. Because

    - the new separate window is unnamed. Therefore the window is not
    reusable nor recyclable. At the very least, don't use _blank at all. If
    you're opening a new window for only 1 link, then you might rethink the
    whole issue again.

    - none of the WAI recommendations are implemented: so users can not know
    in advance that clicking the window will open the referenced resource in
    a new window. This will for sure irritate users.

    DU
     
    DU, Apr 8, 2004
    #15
  16. brucie <> wrote:

    > the appendix c paradox. i really don't see the point of authoring HTML
    > thats pretending to be XHTML pretending to be HTML.


    So you mean we should stick to authoring tag soup that pretends to be
    HTML that pretends to be an application of SGML that pretends to be
    a standard generalized markup language? :)

    (That's what I mean, anyway. Though I might add that we should not
    _unnecessarily_ deviate from the syntax of XHTML that pretends to be an
    application of XML that pretends to be better than SGML.)

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Apr 8, 2004
    #16
  17. Dave Winter

    brucie Guest

    in post: <news:Xns94C56436B1AA1jkorpelacstutfi@193.229.0.31>
    "Jukka K. Korpela" <> said:

    >> the appendix c paradox. i really don't see the point of authoring HTML
    >> thats pretending to be XHTML pretending to be HTML.


    > So you mean we should stick to authoring tag soup that pretends to be
    > HTML that pretends to be an application of SGML that pretends to be
    > a standard generalized markup language? :)


    LOL

    --
    b r u c i e
     
    brucie, Apr 8, 2004
    #17
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TheKeith
    Replies:
    9
    Views:
    1,188
    Leif K-Brooks
    Oct 22, 2003
  2. Simon
    Replies:
    21
    Views:
    3,903
    Lauri Raittila
    Oct 31, 2004
  3. WindAndWaves

    TARGET=_blank not in strict HTML....

    WindAndWaves, Dec 23, 2004, in forum: HTML
    Replies:
    13
    Views:
    980
    kchayka
    Dec 27, 2004
  4. metalive
    Replies:
    24
    Views:
    2,537
  5. Replies:
    7
    Views:
    3,150
Loading...

Share This Page