Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post

    Unable to code validate as HTML5..

    I am having issues with my meta tags as they are not validated, an example of the error I am getting is:

    Bad value language for attribute name on element meta: Keyword language is not registered.
    <meta name="language" content="en" />

    And this error is applying to classification, owner and distribution. Can anyone help?

  • #2
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    411
    Thanks
    2
    Thanked 32 Times in 32 Posts
    The correct way to specify language in HTML5 is in the html tag:
    <html lang="en">

    If you are having trouble with other meta tags post a link to the page or the code with a problem.
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&

  • #3
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,300
    Thanks
    10
    Thanked 283 Times in 282 Posts
    In HTML5 (the current spec, at least) you can't make up meta tags like could be done in earlier versions. So those tags aren't legal. Are they important for something?

    Dave

  • #4
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post
    Hi, thanks for your reply.

    When I use the code you gave me the other meta tags to not come up with an error however a new error has arisen:-

    Line 8, Column 16: Stray end tag html.
    <html lang="en">

    Line 8, Column 16: Cannot recover after last error. Any further errors will be ignored.
    <html lang="en">

  • #5
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post
    Hi Tracknut,

    Tbh I am using them purely because someone said I would help with getting my website crawled and ranked. I always thought it was more tags and descriptions than the others but since they get better ranking than me I thought it was worth a go

  • #6
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,300
    Thanks
    10
    Thanked 283 Times in 282 Posts
    Ah. I haven't seen any discussion on html5 sites rankings in search engines versus simliar html4 sites, so I can't really comment on whether removing those tags will negatively affect your rankings. But if you want to have the site validate as html5, I think the only answer is to remove them. The language one is as CD mentioned, though you might show what the top of your code looks like as I suspect you made a typo or something.

    Dave

  • #7
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post
    My Header code is like this:-

    Code:
    <!DOCTYPE html>
    <head>
    
    <title></title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    
    <html lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="ROBOTS" content="index,follow" />
    <meta name="RATING" content="General" />
    <meta name="revisit-after" content="10 days" /> 
    <meta name="classification" content="" /> 
    <meta name="Subject" content="" /> 
    
    <link href="style.css" rel="stylesheet" type="text/css" />
    
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>
    <script type="text/javascript" src="js/jquery.orbit-1.2.3.min.js"></script>	
    <link rel="stylesheet" type="text/css" href="cookielaw.css"/>
    <script type="text/javascript" src="http://assets.cookieconsent.silktide.com/1.0.8/plugin.min.js"></script>
    <script type="text/javascript">
    // <![CDATA[
    cc.initialise({
    	cookies: {
    		social: {},
    		analytics: {}
    	},
    	settings: {
    		style: "monochrome",
    		bannerPosition: "bottom",
    		disableallsites: true,
    		consenttype: "implicit",
    		hideprivacysettingstab: true
    	},
    	strings: {
    		analyticsDefaultDescription: 'I anonymously measure your use of this website to improve your experience.',
    		notificationTitleImplicit: 'Cookies are being used on this website to improve your viewing experience',
    		seeDetails: 'Read More',
    		seeDetailsImplicit: 'Select your preferences'
    	}
    });
    // ]]>
    </script>
    
    </head>

  • #8
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post
    I have added a post with my header code but it is pending approval. My main reason for changing my webpage to html5 was because I was getting validation errors on my Facebook and Twitter plugins and someone advised me to state html5 as my doctype to fix it, which it did. I am just wondering whether this is still the correct route to follow as I have read its not fully supported by all browsers yet.

  • #9
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,300
    Thanks
    10
    Thanked 283 Times in 282 Posts
    True, html5 is not supported in all browsers. There's no "yet" because the issue is older browsers, which nobody can control, and will never be upgraded. So it's a matter of your balancing your interest in using new html5 capabilities versus the scope of customers you reach. If you're not actually using html5 tags, then the only downside I can think of is that the Facebook or Twitter code you've included might fail in older browsers. I suspect it won't, because they'd be getting lots of complaints if it did. Frankly my guess is you're not accomplishing anything at all with your switch to html5 doctype, other than some personal "feel good" about seeing the validator tell you the code is okay.

    Dave

  • #10
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by charlyanderson View Post
    My Header code is like this:-

    Code:
    <!DOCTYPE html>
    <head>
    
    <title></title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    
    <html lang="en">
    Your HTML tag is in the wrong place - it should be wrapped around the HEAD and BODY tags so that everything except the DOCTYPE is inside it.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #11
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post
    Thanks for your replies, I will change the html tag position.

    I am trying to make my code completely valid, mainly to make sure there's no problems but yes, it is also so I feel ok with it saying its valid.

    The reason for this is because I had a lot of grief from my last project. I made a website for someone and they were completely happy with it. However, someone with coding knowledge decided to test it using code validator and got up two minor errors from plugins like FB and decided to broadcast it to everyone on Facebook. When I stood up to them about it they told me the only person giving me a bad name was me for having errors. So for that reason I am trying to make my websites 100% valid.

  • #12
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,702
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    A basic HTML document looks like this:
    Code:
    <!DOCTYPE html>
    <html>
      <head></head>
      <body></body>
    </html>
    And the HTML opening tag is where the document language is defined.

    Code:
    <!DOCTYPE html>
    <html lang="en">
      <head></head>
      <body></body>
    </html>

  • #13
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post
    Thanks everyone, changing the position of the html tag sorted the problem

  • #14
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,300
    Thanks
    10
    Thanked 283 Times in 282 Posts
    I avoid FB like the plague, but when you go download their plugins, is there a chance that somewhere on the download page they say ".... these plugins are written to HTML xxx specs"? I would think getting that info from the source would be better than inserting them in your code and then having to figure it out for yourself. Or perhaps that's what it is, they're writing them in html5?

    Dave

  • Users who have thanked tracknut for this post:

    charlyanderson (01-03-2013)

  • #15
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post
    Yeah you are right Dave and I amended it yesterday when I noticed


  •  

    Posting Permissions

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