Valid HTML and hyperlinks

M

Mike Mueller

I am trying to make all of my web pages HTML 4.01 Strict.

non-compliant hyperlink
<a href="http://www.domain.com/"
target="_blank">Destination in new Window</a>

how do I fix the issue with 'target='?
 
S

Steve Easton

Who or what program is telling you it's non-compliant??

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
K

Kevin Spencer

Hi Mike,

First, before you inundate us with questions about how to be compliant with
HTML 4.01, here's a reference, straight from the W3C:

http://www.w3.org/TR/REC-html40/

Now, to your specific question.

<a href="http://www.domain.com/"
target="_blank">Destination in new Window</a>

There is nothing wrong with this hyperlink. The target attribute is correct.
So is the rest.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
M

Mike Mueller

The validator at w3c.org is saying it is invalid

page in question: http://mikem.ecinet.net/template.htm
w3c's results:
http://validator.w3.org/check?uri=http://mikem.ecinet.net/template.htm

Mike



: Who or what program is telling you it's non-compliant??
:
: --
: Steve Easton
: Microsoft MVP FrontPage
: 95isalive
: This site is best viewed............
: .......................with a computer
:
message
: : > I am trying to make all of my web pages HTML 4.01
Strict.
: >
: > non-compliant hyperlink
: > <a href="http://www.domain.com/"
: > target="_blank">Destination in new Window</a>
: >
: > how do I fix the issue with 'target='?
: >
: >
: >
:
:
 
K

Kevin Spencer

Hi Mike,

Did some research. Seems that the HTML 4.01 Strict doctype doesn't support
the use of the "target" attribute in an anchor. According to the validation
page you were kind enough to provide:

"You have used the attribute named above in your document, but the document
type you are using does not support that attribute for this element. This
error is often caused by incorrect use of the "Strict" document type with a
document that uses frames (e.g. you must use the "Transitional" document
type to get the "target" attribute), or by using vendor proprietary
extensions such as "marginheight" (this is usually fixed by using CSS to
achieve the desired effect instead). "

After speaking with an HTML guru friend of mine, he told me that "target" is
not supported by the HTML 4.01 strict doctype, unless you are using Frames,
and the W3C site bears this out. He told me that this is one reson why
almost nobody uses the "Strict" version of HTML 4.0. I would recommend using
"Transitional" instead, unless there is some overarching reason why you
should need to use the Strict DTD.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top