htmlw3c-validation

Are multiple angle brackets valid in HTML?


validator.w3.org considers the following valid HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <title>Test</title>
 </head>
 <body>
  <div>This <<<<<<<<<<<<<<<<<<<<<<b>is</b> a test.</div>
 </body>
</html>

Is it really valid?


Solution

  • Yes, the tag would just be treated as additional text. It's not part of the HTML tag.

    It'd just print

    This <<<<<<<<<<<<<<<<<<<<<is a test.

    Nothing wrong with that.