...

View Full Version : Unable to code validate as HTML5..



charlyanderson
12-30-2012, 06:11 PM
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?

COBOLdinosaur
12-30-2012, 06:27 PM
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.

tracknut
12-30-2012, 07:01 PM
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

charlyanderson
12-30-2012, 07:01 PM
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">

charlyanderson
12-30-2012, 07:03 PM
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

tracknut
12-30-2012, 07:08 PM
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

charlyanderson
12-30-2012, 07:31 PM
My Header code is like this:-



<!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>

charlyanderson
12-30-2012, 07:37 PM
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.

tracknut
12-30-2012, 08:09 PM
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

felgall
12-30-2012, 08:54 PM
My Header code is like this:-



<!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.

charlyanderson
12-31-2012, 10:54 AM
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.

VIPStephan
12-31-2012, 02:39 PM
A basic HTML document looks like this:


<!DOCTYPE html>
<html>
<head></head>
<body></body>
</html>


And the HTML opening tag is where the document language is defined.



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

charlyanderson
12-31-2012, 03:57 PM
Thanks everyone, changing the position of the html tag sorted the problem :)

tracknut
12-31-2012, 04:43 PM
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

charlyanderson
12-31-2012, 05:26 PM
Yeah you are right Dave and I amended it yesterday when I noticed :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum