How to fix: Required attribute "content" not specified

Most Likely Cause and Fix

You have used the HTML5 method of specifying your document's content type in a HTML4 or XHTML document.

Use:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

instead of:

<meta charset="utf-8">

What This Error Means

There is a defined set of attributes for each HTML element. Some are required for your markup to be considered valid.

You have omitted the required content attribute on an element that requires it.

How To Fix It

The specific error message you encountered will refer to a line and column number. This will guide you to the exact point in your markup to which the error relates.

For meta elements

You have used the HTML5 method of specifying your document's content type in a HTML4 or XHTML document.

Use:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

instead of:

<meta charset="utf-8">

Ensure all <meta /> elements your HTML4 or XHTML document have the required content attribute.

In general

Find the relevant element and add the missing content attribute.

Discuss, Comment and Improve

Did this help you? Can this page be improved? Let us know!

comments powered by Disqus