Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-30-2012, 05:11 PM   PM User | #1
charlyanderson
Regular Coder

 
Join Date: Dec 2012
Posts: 111
Thanks: 14
Thanked 1 Time in 1 Post
charlyanderson is an unknown quantity at this point
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?
charlyanderson is offline   Reply With Quote
Old 12-30-2012, 05:27 PM   PM User | #2
COBOLdinosaur
Regular Coder

 
COBOLdinosaur's Avatar
 
Join Date: Jul 2002
Location: Canada
Posts: 299
Thanks: 1
Thanked 18 Times in 18 Posts
COBOLdinosaur is an unknown quantity at this point
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&
COBOLdinosaur is offline   Reply With Quote
Old 12-30-2012, 06:01 PM   PM User | #3
tracknut
Regular Coder

 
Join Date: Aug 2006
Posts: 906
Thanks: 4
Thanked 212 Times in 211 Posts
tracknut is an unknown quantity at this point
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
tracknut is online now   Reply With Quote
Old 12-30-2012, 06:01 PM   PM User | #4
charlyanderson
Regular Coder

 
Join Date: Dec 2012
Posts: 111
Thanks: 14
Thanked 1 Time in 1 Post
charlyanderson is an unknown quantity at this point
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 is offline   Reply With Quote
Old 12-30-2012, 06:03 PM   PM User | #5
charlyanderson
Regular Coder

 
Join Date: Dec 2012
Posts: 111
Thanks: 14
Thanked 1 Time in 1 Post
charlyanderson is an unknown quantity at this point
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
charlyanderson is offline   Reply With Quote
Old 12-30-2012, 06:08 PM   PM User | #6
tracknut
Regular Coder

 
Join Date: Aug 2006
Posts: 906
Thanks: 4
Thanked 212 Times in 211 Posts
tracknut is an unknown quantity at this point
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
tracknut is online now   Reply With Quote
Old 12-30-2012, 06:31 PM   PM User | #7
charlyanderson
Regular Coder

 
Join Date: Dec 2012
Posts: 111
Thanks: 14
Thanked 1 Time in 1 Post
charlyanderson is an unknown quantity at this point
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>
charlyanderson is offline   Reply With Quote
Old 12-30-2012, 06:37 PM   PM User | #8
charlyanderson
Regular Coder

 
Join Date: Dec 2012
Posts: 111
Thanks: 14
Thanked 1 Time in 1 Post
charlyanderson is an unknown quantity at this point
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.
charlyanderson is offline   Reply With Quote
Old 12-30-2012, 07:09 PM   PM User | #9
tracknut
Regular Coder

 
Join Date: Aug 2006
Posts: 906
Thanks: 4
Thanked 212 Times in 211 Posts
tracknut is an unknown quantity at this point
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
tracknut is online now   Reply With Quote
Old 12-30-2012, 07:54 PM   PM User | #10
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,530
Thanks: 0
Thanked 503 Times in 494 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
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/
felgall is offline   Reply With Quote
Old 12-31-2012, 09:54 AM   PM User | #11
charlyanderson
Regular Coder

 
Join Date: Dec 2012
Posts: 111
Thanks: 14
Thanked 1 Time in 1 Post
charlyanderson is an unknown quantity at this point
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.
charlyanderson is offline   Reply With Quote
Old 12-31-2012, 01:39 PM   PM User | #12
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,701
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
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>
__________________
Don’t click this link!
VIPStephan is online now   Reply With Quote
Old 12-31-2012, 02:57 PM   PM User | #13
charlyanderson
Regular Coder

 
Join Date: Dec 2012
Posts: 111
Thanks: 14
Thanked 1 Time in 1 Post
charlyanderson is an unknown quantity at this point
Thanks everyone, changing the position of the html tag sorted the problem
charlyanderson is offline   Reply With Quote
Old 12-31-2012, 03:43 PM   PM User | #14
tracknut
Regular Coder

 
Join Date: Aug 2006
Posts: 906
Thanks: 4
Thanked 212 Times in 211 Posts
tracknut is an unknown quantity at this point
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
tracknut is online now   Reply With Quote
Users who have thanked tracknut for this post:
charlyanderson (01-03-2013)
Old 12-31-2012, 04:26 PM   PM User | #15
charlyanderson
Regular Coder

 
Join Date: Dec 2012
Posts: 111
Thanks: 14
Thanked 1 Time in 1 Post
charlyanderson is an unknown quantity at this point
Yeah you are right Dave and I amended it yesterday when I noticed
charlyanderson is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:25 PM.


Advertisement
Log in to turn off these ads.