Skip to main content
HTML Validation

Bad value “” for attribute “type” on element “a”: Expected a MIME type but saw the empty string.

About This HTML Issue

Empty type attributes are invalid on the <a> element; you must either remove the type attribute or provide a valid MIME type value.

The type attribute on an <a> (anchor) element specifies the MIME type of the linked resource. According to the WHATWG HTML specification and W3C validator, the value of the type attribute cannot be an empty string. It should be a valid MIME type, such as application/pdf or text/html. If you do not know the MIME type or it’s not relevant, you should omit the attribute.

Incorrect HTML example (causes validation error):

<a href="document.pdf" type="">Download PDF</a>

Correct HTML example (remove the invalid attribute):

<a href="document.pdf">Download PDF</a>

Correct HTML example (provide a valid MIME type):

<a href="document.pdf" type="application/pdf">Download PDF</a>

If the type is unknown or unnecessary, leaving it out is preferred to using an empty value.

Find issues like this automatically

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

Help us improve our guides

Was this guide helpful?

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