...

View Full Version : document type does not allow element "div" here



cyborg360
01-01-2010, 02:25 AM
Is the problem reported by W3C just telling me I can't have a div within a div or something else? What types of problems does this normally create (div w/in div)? site is here (http://users.rcn.com/**************/test66.html).


<div style="width: 225px; float: left; height: 16px; background-color: #000000; color: #FFFFFF; margin-left: 0px; margin-bottom: 0px; font-size: small; padding-left: 0px;">
&nbsp;<img src="images/news.png" height="16" width="222" /><div style="width: 226px; height: 155px; float: left;"><script type="text/javascript">if(document.layers){document.write('<ilayer id="ns4div" width="'+swidth+'" height="'+sheight+'" bgcolor='+sbcolor+'><layer id="ns4div1" width="'+swidth+'" height="'+sheight+'" onmouseover="sspeed=0;" onmouseout="sspeed=rspeed"></layer></ilayer>')}
if(document.getElementById||document.all){document.write('<div style="position:relative;overflow:hidden;width:'+swidth+'px;height:'+sheight+'px;clip:rect(0 '+swidth+'px '+sheight+'px 0);background-color:'+sbcolor+';" onmouseover="sspeed=0" onmouseout="sspeed=rspeed"><div id="iens6div" style="position:relative;width:'+swidth+'px;"></div></div>');}</script>
</div></div>



Line 138, Column 267: document type does not allow element "div" here
…sspeed=0" onmouseout="sspeed=rspeed"><div id="iens6div" style="position:relat

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

KatoPC
01-01-2010, 03:36 AM
Curious??

What did you use for the bg?

oesxyl
01-01-2010, 03:40 AM
Is the problem reported by W3C just telling me I can't have a div within a div or something else? What types of problems does this normally create (div w/in div)? site is here (http://users.rcn.com/**************/test66.html).


<div style="width: 225px; float: left; height: 16px; background-color: #000000; color: #FFFFFF; margin-left: 0px; margin-bottom: 0px; font-size: small; padding-left: 0px;">
&nbsp;<img src="images/news.png" height="16" width="222" /><div style="width: 226px; height: 155px; float: left;"><script type="text/javascript">if(document.layers){document.write('<ilayer id="ns4div" width="'+swidth+'" height="'+sheight+'" bgcolor='+sbcolor+'><layer id="ns4div1" width="'+swidth+'" height="'+sheight+'" onmouseover="sspeed=0;" onmouseout="sspeed=rspeed"></layer></ilayer>')}
if(document.getElementById||document.all){document.write('<div style="position:relative;overflow:hidden;width:'+swidth+'px;height:'+sheight+'px;clip:rect(0 '+swidth+'px '+sheight+'px 0);background-color:'+sbcolor+';" onmouseover="sspeed=0" onmouseout="sspeed=rspeed"><div id="iens6div" style="position:relative;width:'+swidth+'px;"></div></div>');}</script>
</div></div>

before fixing something else remove the BOM from the begining of the file.

in xhtml all tags elements are lower case, <A will be <a

best regards

cyborg360
01-01-2010, 03:44 AM
before fixing something else remove the BOM from the begining of the file.

in xhtml all tags elements are lower case, <A will be <a

best regards

great, that works, of course.

Excavator
01-01-2010, 03:51 AM
cyborg360,
You have 122 errors in that code. Don't start in the middle of the list.
The way the validator works it's best to start at the top and work your way down. Sometimes fixing one error at the top eliminates 10 errors below it.

oesxyl
01-01-2010, 03:53 AM
great, that works, of course.
many errors seems to come from javascript code included in the head section.
try to put cdata and comments there.

best regards

cyborg360
01-01-2010, 03:53 AM
cyborg360,
You have 122 errors in that code. Don't start in the middle of the list.
The way the validator works it's best to start at the top and work your way down. Sometimes fixing one error at the top eliminates 10 errors below it.

hah, glad you told me that. I started around line 137 because some of the code for the news ticker that was giving me problems was listed around 137. Seemed logical to start there at the time.

cyborg360
01-01-2010, 04:29 AM
Curious??

What did you use for the bg?

i dont follow you...what did I use for the background? which bg?

KatoPC
01-01-2010, 04:38 AM
Body bg

cyborg360
01-01-2010, 04:40 AM
Body bg


<body onload="start(); BGchange();" style="background-image: url('images/background.png'); margin-top: 25px; background-color: #000000; width: 930px; margin-left: auto; margin-right: auto">


hope that answers your question; if it doesnt, let me know. theres also a link to the page in the first post of this thread.

Excavator
01-01-2010, 04:40 AM
Curious??

What did you use for the bg?

http://users.rcn.com/**************/images/background.png

KatoPC
01-01-2010, 04:45 AM
Hmm ic its a fixed size image? Resizes to any size window

Thankyou



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum