SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Enthusiast murphaloid's Avatar
    Join Date
    Oct 2011
    Posts
    54
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,331
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    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.

  3. #3
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,761
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    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 .
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,331
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by RyanReese View Post
    The title attribute on a meta tag is invalid. It's not part of HTML.
    <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/stru...l.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.
    Last edited by ralph.m; Mar 20, 2012 at 17:43. Reason: D'oh, meant name=, not title=

  5. #5
    SitePoint Enthusiast murphaloid's Avatar
    Join Date
    Oct 2011
    Posts
    54
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    <meta tite="" ...> 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/stru...l.html#h-7.4.2


    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?

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,331
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by murphaloid View Post
    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.

  7. #7
    SitePoint Enthusiast murphaloid's Avatar
    Join Date
    Oct 2011
    Posts
    54
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Great! Thanks for your help guys

  8. #8
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,761
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Yes.
    If having it is causing a validation error, I do believe that makes it invalid .
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  9. #9
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    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.

    Quote Originally Posted by Let's look more closely at what it sayeth
    Error Line 7, Column 84: Bad value title for attribute name on element meta: Keyword title is not registered.
    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.

  10. #10
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,331
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by RyanReese View Post
    If having it is causing a validation error, I do believe that makes it invalid .
    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?

  11. #11
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,761
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    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.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  12. #12
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Don't worry guys I know, what I am talking about anyway or at least occasionally.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •