简体   繁体   中英

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 canvas!

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM