Why in this code after <plaintext>
every thing is encoded? even </plaintext>
or </body>
:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<p>The markup for this is 01</p>
<plaintext>
<h1>Main heading goes here</h1>
<p>First paragraph goes here</p>
<h2>Sub-heading goes here</h2>
</plaintext>
<p>The markup for this is 02</p>
<h2>test 01</h2>
<h2>test 02</h2>
</body>
</html>
Because that is what
<plaintext>
does:(my emphasis)
<plaintext>
drinks your HTML milkshake, and everything after it is No Longer HTML.<plaintext>
is a kick in the head for any HTML document; even more, it makes no sense at all in an XHTML document (which mandates that every tag is correctly nested and closed).There is only one possible use of
<plaintext>
: to paste a HTML header above any plain text document, without having to check and adjust the contents of said document.Fun fact
<plaintext>
appeared in the very first list of HTML codes as distributed by Tim Berners-Lee in 1992. Note the last paragraph.(source: http://www.w3.org/History/19921103-hypertext/hypertext/WWW/MarkUp/Tags.html)