Skip to main content

HTML Guide

Stray start tag “style”.

A <style> start tag has been found in an unexpected place in the document structure. Check that the <style> section appears within the <head> section.

Although in general it’s better to put your styles in external stylesheets and apply them using <link> elements, CSS styles can also be included inside a document using the <style> tag. In this case, it should be placed within the <head> section, like in this example:

<!DOCTYPE html>
<html>
  <head>
    <title>Test</title>
    <style>
      p {
        color: #26b72b;
      }
    </style>
  </head>
  <body>
    <p>This text will be green.</p>
  </body>
</html>

Learn more:

Related W3C validator issues