![]() |
|
|
|||||||
![]() |
HTML - XHTML Strict - using target inside <a> |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
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/> |
|
|
|
#4 |
|
Posts: n/a
|
"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. |
|
|
|
#5 |
|
Posts: n/a
|
"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/> |
|
|
|
#6 |
|
Posts: n/a
|
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 |
|
|
|
#7 |
|
Posts: n/a
|
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> |
|
|
|
#8 |
|
Posts: n/a
|
"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? |
|
|
|
#9 |
|
Posts: n/a
|
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/> |
|
|
|
#10 |
|
Posts: n/a
|
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? |
|