Errors in W3 Validator

I checked my website, in the w3 validator and got these three errors:

Line 45, Column 48: there is no attribute “alt”

Line 126, Column 14: ID “cse-search-results” already defined

Line 117, Column 14: ID “cse-search-results” first defined here

I don’t understand how the “alt” is an error in line 45? I thought this was accepted and good for SEO?

The other two errors are the code I pasted from Google Adsense, did I not plug them in correct?

Any help would be greatly appreciated!

Line 45, Column 48: there is no attribute “alt”

<a href=“” alt=“blacktipH fishing”>
Maybe the alt attribute in the a tag?

alt is just for images, not links.

An ID can only be used once per page.

Things like Google Adsense etc are never very concerned about good code, I’m afraid. If the code came with those divs with the same ID, this just proves it. But if they are yours, just change that ID to a class and you’ll be right (if you really need those divs at all … I was too lazy to locate them to check what they’re for).

I didn’t know that, thank you very much! :slight_smile:

The ID is a unique identifier like was mentioned you also have several other errors like putting the value ‘px’ on your width and height units in several places - I mean with the HTML not the inline CSS, i.e. width=" " and height=" "

Perhaps you were thinking of the ‘title’ attribute on a anchor rather than the ALT attribute and got slightly cofuddled.

I don’t understand how the “alt” is an error in line 45? I thought this was accepted and good for SEO?

As a general rule, if you are not terribly familiar with HTML, assume everything that’s called “good for SEO” is something you shouldn’t do.

I’ve only heard a few “it’s good for SEO” declarations that were also actually good code ideas.

The alt attribute is only valid for images because its only purpose is to provide ALTernative text to be used for those people who can’t see the image (eg. those using text only browsers, web readers, or who simply have images turned off in their browser).

The alt attribute should attempt to provide those who can’t see the image with equivalent information to what the image is there for. It has NOTHING to do with SEO except in that as search engines cannot see the image, they too rely on the alt text to provide them with the information that the image is there to provide.

As search engines are only a minority of those who can’t see the image you shouldn’t be trying to spam the search engines by filling the alt text with content specifically for SEO purposes - that is one aspect of black hat SEO (which means that the search engines are actively trying to identify sites using that practice to gain higher search result placement sio that they can ban them).

I think the OP got a little confused - the alt attribute is (by and large) used for the image tag - it can’t be used for links

Although having an alt attribute on an image is hardly black hat… search engine spiders will read it just as people with text readers or have images switched off will. But it isn’t some kind of magic bullet to get you higher in the results

So just as with every other bit of HTML using it well (text that someone without images will want to read) will help with SEO, using it badly (keyword stuffing) won’t