title: Whether browser recognize document HTML version
body: <p>I have a html document written in HTML 4. I used <strong>required</strong> attribute from HTML 5 which worked properly to my surprise. I saw error red border when input was empty.
  I think that browser recognized this document as HTML 5 document and ignored DOCTYPE. 
  My question is, how browser like Google Chrome recognize html document version. </p>
  
  <p>Thanks for the hints.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;style&gt;
          input:invalid {
              border: 2px dashed red;
          }
  
          input:valid {
              border: 2px solid black;
          }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form&gt;
      &lt;label for="name"&gt;Name&lt;/label&gt;
      &lt;input id="name" name="name" required&gt;
      &lt;button&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>