Validation Error

Hi

I’m getting this validation error at w3 validator:

Error Line 7, Column 84: Bad value title for attribute name on element meta: Keyword title is not registered.

…ta name=“title” content=“Man in Fear - When is an accident not an accident?” />

…I’m using a HTML5 Doctype, and dont really know what Im doing with meta tags yet.

Can anyone explain why it has a problem with “title”

Thanks

The real title element just looks like this:

<title>Man in Fear - When is an accident not an accident?</title>

That’s what serch engines mainly use, I believe.

I don’t know what they do with the meta equivalent, but I never see it used, so perhaps it’s been dropped from HTML5.

The title attribute on a meta tag is invalid. It’s not part of HTML. If you meant content=“blah blah” than you need to change it :).

<meta name="" ...> is used, and isn’t technically invalid, as you can theoretically have any kind of meta tag properties (as I understand it).

http://www.w3.org/TR/REC-html40/struct/global.html#h-7.4.2

The META element can be used to identify properties of a document (e.g., author, expiration date, a list of key words, etc.) and assign values to those properties. This specification does not define a normative set of properties.

There doesn’t seem to be any obligation for user agents to recognize them, though. The <title></title> element is the standard way of indicating a page title, so just use that.

Ah so you mean just drop the meta tag with ‘title’ in, and just let the <title> tag in the head do the same job?

Yes. :slight_smile:

Great! Thanks for your help guys :slight_smile:

If having it is causing a validation error, I do believe that makes it invalid ;).

We aren’t talking about a title attribute here it is a ‘name’ value by the looks of things: <meta name=“[…]” content=“Man in Fear - When is an accident not an accident?” />

Though without the full META element code example in post#1; it is hard to tell but I suspect it was supposed to read ‘description’ or another valid word.

The Validator clearly states the NAME attribute has an INVALID (custom) value nothing more.

Obviously META itself can have a title attribute in FRED5 (because it is stupidly lax) but like I said it was the name attribute value at fault. Obviously a normative language like XHTML 1.x does NOT allow a title attribute (title=“…”) on META but we are analysing the ‘name’ not ‘title’ attribute anyway.

As you can plainly see ‘title’ isn’t a Fred5 ‘registered keyword’ or ‘standard meta name’ for example: http://dev.w3.org/html5/spec/semantics.html#standard-metadata-names

Though to be honest you’d probably be better using a normative markup language like HTML 4.01 anyway. :slight_smile:

The OP asked if using a <title></title> element in the head was the way to go, and I said Yes. What’s the problem?

My eyes.

Don’t worry guys I know, what I am talking about anyway or at least occasionally. :slight_smile: