开发者

Need HTML5 XML-mode "Hello, World" trivial web page example

I feel stupid... my desire is to write HTML5 using XML and I can't get ANYTHING to work, for instance:

<!DOCTYPE html>
<html>
<head><title>ABC</title></head>
<body>DEF</body>
</html>

actually shows ABC on the browser canva开发者_开发知识库s!

What am I doing wrong? (using FireFox 3.5.8)


You need to declare a namespace on the root element. For HTML that is http://www.w3.org/1999/xhtml. A DOCTYPE is not needed in XML.


I’m on Firefox 3.5.2. I saved the code in your question as a file (abc.html) and opened it in Firefox. “ABC” didn’t show on the browser canvas.

What mimetype are you serving it with? What file extension?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜