Forum Moderators: open

Message Too Old, No Replies

This might be a bit odd but...

         

Liquibyte

7:53 pm on Dec 6, 2003 (gmt 0)



I was doing a search and saw this post on google. The answer was never posted and I hate seeing questions left open like this. I know the admins have turned off replies after a post is so old, but I thought that this one at least deserved an answer. So much so, that is why I signed up here.

Posted by one Raphael

Hiya!

I wonder if anyone here can spot, at a glance, why this code would fail to validate:

<!DOCTYPE html PUBLIC "-//W3C//DTD xhtml 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<title></title>
</head>
<body>
<a href="blah.shtml" title="target blank this smeggin thing" onclick="self.target=blank">close</a>
</body>
</html>

It's a variation of something I found here

Also, I found another webpage which says that the following will validate:

<a href="xjkwx" title="close this window" onclick="window.self.close()">close</a>

It doesn't - at least not for 1.1 (the page says it will for 1.0).

What the heck is going on here?

Also, can anyone recommend any good books for learning xhtml? Somethign in the WROX style (examples first, explanations second, rather than the traditional explanation first, followed by [only if you're lucky] examples).

The answer to this is:

<!DOCTYPE html PUBLIC "-//W3C//DTD xhtml 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<title>title</title>
</head>
<body>
<p><a href="blah.shtml" title="target blank this smeggin thing" onclick="self.target=blank">close</a></p> <!--the a attribute should be inside a defining tag-->
</body>
</html>

g1smd

10:20 pm on Dec 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A lot of people don't realise that certain HTML tags are only really valid when inside a paragraph, list, or table. Many browsers let you get away with it, but that doesn't make it right. Good answer.