...

View Full Version : Validation errors



j05hr
11-03-2009, 02:18 AM
I'm helping a friend validate his page and got down to the last two errors which I can't solve.

Line 43, Column 316: document type does not allow element "a" here; missing one of "object", "span", "bdo", "applet", "iframe", "tt", "i", "b", "u", "s", "strike", "big", "small", "font", "em", "strong", "dfn", "code", "q", "samp", "kbd", "var", "cite", "abbr", "acronym", "sub", "sup", "label", "ins", "del" start-tag

Line 43


<!-- Facebook Badge START --><a href="http://www.facebook.com/abintus" title="Peter Dunphy" target="_TOP" style="font-family: &quot;lucida grande&quot;,tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;"/>Peter Dunphy</a><br/><a href="http://www.facebook.com/abintus" title="Peter Dunphy" target="_TOP"/><img src="http://badge.facebook.com/badge/585745310.4691.274417441.png" width="120" height="136" alt="alt" style="border: 0px;" /><br/><a href="http://www.facebook.com/facebook-widgets/" title="Make your own badge!" target="_TOP" style="font-family: &quot;lucida grande&quot;,tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;"/>Create Your Badge<!-- Facebook Badge END -->



Line 75, Column 53: required attribute "type" not specified

Line 75


<script src="http://widgets.twimg.com/j/2/widget.js"></script>

tomws
11-03-2009, 03:38 AM
First error: Your first anchor tag appears to be both self-closed and used with a closing tag. Double-check that and choose just one way.

Second error: self-explanatory. What "type" is your script? You need to add type="text/javascript" to the script tag.

j05hr
11-03-2009, 04:01 AM
I sorted the second error, but for the first one, what's the two different ways it can be done? Would it be possible to post both options as I'm not sure of them.

Thanks for the help

tomws
11-03-2009, 04:03 AM
<a href="somewhere.htm">I'm a link</a>
<a href="uselesslink.htm" />

_Aerospace_Eng_
11-03-2009, 06:17 AM
Also this

font-family: &quot;lucida grande&quot;
should be this

font-family: 'lucida grande'

j05hr
11-03-2009, 11:14 PM
Hi tomws, I been trying to play with what you said last night but still can't get it right, is there any chance you can show me both ways for the code I posted as the example to see exactly how it's done? Both of your examples have closing tags at the end of the link and then it makes all the code after it not work.
Thanks for all the help today!
Josh

tomws
11-03-2009, 11:56 PM
The first has a closing tag. The second is self-closed. As far as I know, self-closed links (anchors) are useless. You have more than one self-closed anchor in the code.

Make it easier on yourself to debug. Break that horribly long line into smaller lines and then re-validate. It should help to target exactly where your problem is.

j05hr
11-04-2009, 12:04 AM
It is this closing tag that is causing the problem



text-decoration: none;"/>Peter Dunphy

tomws
11-04-2009, 12:53 AM
Remove the slash.

j05hr
11-04-2009, 12:59 AM
That's what confuses me and what I did originally and that gives 8 errors instead of 1 and one of the errors is still that closing tag.

tomws
11-04-2009, 01:10 AM
Ok, let's try another tack. Here's your code with all tag attributes removed.

<!-- Facebook Badge START -->
<a/>
Peter Dunphy
</a>
<br/>
<a/>
<img/>
<br/>
<a/>
Create Your Badge
That should make it exceedingly obvious where the problems are:

<!-- Facebook Badge START -->
<a/> <!-- Look at me. I'm a useless self-closing anchor. -->
Peter Dunphy <!-- I'm text just hanging out in the open. I'll bet I should be an anchor. -->
</a> <!-- Hey, I'm a closing tag with no associated opening tag. -->
<br/>
<a/> <!-- Look at me. I'm a useless self-closing anchor. -->
<img/> <!-- I'm an image just hanging out in the open. I'll bet I should be an anchor. -->
<br/>
<a/> <!-- Look at me. I'm a useless self-closing anchor. -->
Create Your Badge <!-- I'm text just hanging out in the open. I'll bet I should be an anchor. -->
Making some assumptions that you really want some links and working code, I'd do this:

<!-- Facebook Badge START -->
<a>
Peter Dunphy
</a>
<br/>
<a>
<img/>
</a>
<br/>
<a>
Create Your Badge
</a>
If you want a link, the link text/image must be wrapped by anchor tags. That means there must be an open and a close.

Labhrainn Aemi
11-07-2009, 05:26 AM
W3 Consortium has specified a set of rules about how the HTML page should designed. Validating the HTML means sticking to those rules. By validating you will make sure that all the browsers will display the HTML content in more or less the same way (even the browsers that you have not tested your HTML pages on).Since all browsers will keep the specification of W3C in mind while designing the browsers. It is important to validate so that you will not have to change it when new browsers are made.
PSD to HTML Conversion (http://www.codecopia.com/psd-html-conversion.php)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum