Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am trying to get my pages validated using Markup Validation Service on W3C validator.

We are getting validation against the XHTML 1.0 Strict doctype comes back with the following error:

... there is no attribute "data-gid"

Because of the following code:

<a href="#" class="addToCartLink" data-gid="202">Add to Inquiry List</a>

From the follwing page: http://dev.contractorshire.co.uk/catalog/plant/mini-digger/.

We have been advised that we need to use the Html5 doctype. We have changed to the above doctype on this page now however the point of this excercise was to make sure the site is clean to help with SEO.

I would like to use the html5 doctype with html5 markup.

Here is the questoin: Is there any difference, from SEO perspective, between valid HTML5 or XHTML 1.0 Strict? Should I try to stay on (valid) XHTML 1.0 Strict doctype/markup or is it OK to move to vallid HTML5 doctype/markup?

share|improve this question
    
can you please specify your question? you are using html5 markup but with a xhtml 1.0 strict doctype? the other way around? why not adding the html5 doctype with html5 markup? –  DKOATED Apr 15 '13 at 13:57
1  
sorry my bad: I would like to use the html5 doctype with html5 markup. Here is the questoin: Is there any difference, from SEO perspective, between valid HTML5 or XHTML 1.0 Strict? Should I try to stay on (valid) XHTML 1.0 Strict doctype/markup or is it OK to move to vallid HTML5 doctype/markup? –  Geoffery Holland Apr 15 '13 at 14:23
add comment

1 Answer 1

You need to familiarize yourself with DOC-TYPE markups.

At the moment your attempting to use both HTML5 and XHTML which is not possible, its one or other.

So at the moment you using:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

For HTML5 it should look like:

<!DOCTYPE html>

If you want it to Validate in XHTML 1.0 Transitional then it should look like:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Data-GID HTML5

The attribute data-gid is only valid in HTML5 so your pages should only use <!DOCTYPE html> if you want to validate your pages in XHTML then you need to remove the data-gid attribute and use another attribute that is supported in XHTML. Your pages validate absolutely fine when using HTML5 validation, so your only problem is that you need to remove: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> as this line is not required for HTML5 markup.

SEO Factors

There is no major or minor SEO value in using XHTML or HTML5 markups, as long as the page validates then Google, Bing and Yahoo will process your data without problems. The good thing is that your page is validating with HTML5. Time to focus on other things ;)

share|improve this answer
    
both of you - thanks so mcuh and for being so quick - really appreciated! –  Geoffery Holland Apr 15 '13 at 14:35
    
Agree 99% with your answer. However I find adding "rich snippets" is easier using Microdata, which an HTML5 standard. And Microdata markup can really help with SEO. Of course the same can be achieved using XHTML 1.0 and RDFa or Microformats, but having as many tools at one's disposal is usually preferred, IMHO. –  nathangiesbrecht Apr 15 '13 at 19:38
    
use schema which is fully html5 compatible and most promising out of all of the formats –  bybe Apr 15 '13 at 19:47
    
Just to be clear, invalid HTML code is not bad for SEO. Only in the very rare case that it's a complete tag soup mess that cannot be parsed. –  DisgruntledGoat Apr 15 '13 at 23:45
    
Most SEOs agree that W3C validation does matter when it comes to SEO, but only for errors that cause bad rendering. –  bybe Apr 16 '13 at 0:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.