How to fix: An attribute value specification must be an attribute value literal unless shorttag yes is specified

Most Likely Cause and Fix

Your markup document contains a non-quoted attribute value similar to:

<div id=foo>
  …
</div>

Ensure all attribute values are contained in double quotes:

<div id="foo">
  …
</div>

What This Means

This error is telling you that your markup contains a non-quoted attribute value as given in the above example.

The wording of this message originates in SGML, the markup language in which HTML and XHTML are defined.

Despite the wording of this error, there is nothing you, as an HTML or XHTML author, can do to specify the SHORTTAG attribute. This is not a HTML attribute but an SGML attribute, that is an attribute for the language in which HTML is defined.

How To Fix It

Ensure all attribute values are contained in double quotes:

Use:

<div id="foo">
  …
</div>

instead of:

<div id=foo>
  …
</div>

Discuss, Comment and Improve

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

comments powered by Disqus