Connecting Tech Pros Worldwide Forums | Help | Site Map

validation error help

Newbie
 
Join Date: Feb 2007
Posts: 3
#1: Feb 15 '07
I have started again after my previous effort had so many errors.

the url is http://www.freebetsonline.info/freebets2.html.

using the w3c validation page I have 5 errors, four are the same error.
the errors are:

Error Line 68 column 31: there is no attribute "background".
<td height="94" background="../images/bannertitle1.gif"><iframe align="right

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

and 4 of this error:
Error Line 87 column 42: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.
<font size="1"><div style="float:left">BlueSq</div></font>

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

im trying to have writing left aligned and also right aligned in one table cell, how can i fix these errors? the alignment shows up correct on the page.
thanks

drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,566
#2: Feb 15 '07

re: validation error help


The problem is you are applying <font> and <strong> and other text elements to the <div> element which doesn't make sense. A <div> is used to contain other elements so you should make it contain those tags plus the text you have there.

But I don't see the reason for the div at all. You have the text contained in a data cell so why the div?

Also, why do you use the font tags, background stuff and so on instead of putting it in your css? xhtml requires it but it will work because it is being served as html.

Your doctype is still incomplete. It should be:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
Newbie
 
Join Date: Feb 2007
Posts: 3
#3: Feb 15 '07

re: validation error help


hi,

thanks for the reply. I am using div as i want part of the text in one cell to be aligned to the left and part to the right.

ie
bet £25

i dont understand what you mean about the font tags and background tags, do you mean I should create a css element for these?

sorry about this, im just learning :o)

thanks
Expert
 
Join Date: Oct 2006
Location: NC
Posts: 1,722
#4: Feb 22 '07

re: validation error help


Quote:

Originally Posted by mightyreds

hi,

thanks for the reply. I am using div as i want part of the text in one cell to be aligned to the left and part to the right.

ie
bet £25

i dont understand what you mean about the font tags and background tags, do you mean I should create a css element for these?

sorry about this, im just learning :o)

thanks

Certain tags have been deprecated such as font etc.. the new standard is to use CSS. Here is a great place to get started learning.

Aric
Reply