Can XHTML nest more XHTML?
It's legal to nest SVG documents inside XHTML documents; but is it legal to nest XHTML documents inside other XHTML documents in the same fashion?
<!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>
<title>Sup</title>
</head>
<body>
<h1>Hello World!</h1>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Nested document</title>
</head>
<body>
<p>This is a sample</p>
</body>
</html>
&l开发者_StackOverflowt;/body>
</html>
No, the html
element is only allowed as root element of the document.
You can, using <iframe>
(though not recommended and should be avoided).
精彩评论