Skip to main content
HTML Validation

The “type” attribute for the “style” element is not needed and should be omitted.

About This HTML Issue

The HTML <style> element contains style information for a document, or part of a document, defined in CSS. This element does not need the type attribute anymore, so it should be omitted.

For example, this style defines that <p> elements should be in red color.

<style type="text/css">
p {
  color: red;
}
</style>
<p>This text will be red.</p>

But, the type attribute is not used anymore, so we can just use this:

<style>
p {
  color: red;
}
</style>
<p>This text will be red.</p>

Last reviewed: September 02, 2024

Was this guide helpful?

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Ready to validate your sites?
Start your free trial today.