Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    Regular Coder
    Join Date
    Nov 2009
    Posts
    202
    Thanks
    25
    Thanked 0 Times in 0 Posts

    document type does not allow element "div" here

    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.

    Code:
      <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).

  • #2
    New Coder
    Join Date
    Dec 2009
    Location
    MN
    Posts
    34
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Curious??

    What did you use for the bg?

  • #3
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by cyborg360 View Post
    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.

    Code:
      <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.

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


    best regards
    Last edited by oesxyl; 01-01-2010 at 04:42 AM.

  • #4
    Regular Coder
    Join Date
    Nov 2009
    Posts
    202
    Thanks
    25
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by oesxyl View Post
    before fixing something else remove the BOM from the begining of the file.

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


    best regards
    great, that works, of course.
    Last edited by cyborg360; 01-01-2010 at 04:48 AM.

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,678
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #6
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by cyborg360 View Post
    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

  • #7
    Regular Coder
    Join Date
    Nov 2009
    Posts
    202
    Thanks
    25
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    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.

  • #8
    Regular Coder
    Join Date
    Nov 2009
    Posts
    202
    Thanks
    25
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by KatoPC View Post
    Curious??

    What did you use for the bg?
    i dont follow you...what did I use for the background? which bg?
    Last edited by cyborg360; 01-01-2010 at 05:32 AM.

  • #9
    New Coder
    Join Date
    Dec 2009
    Location
    MN
    Posts
    34
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Body bg

  • #10
    Regular Coder
    Join Date
    Nov 2009
    Posts
    202
    Thanks
    25
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by KatoPC View Post
    Body bg
    Code:
     <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.

  • #11
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,678
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by KatoPC View Post
    Curious??

    What did you use for the bg?
    http://users.rcn.com/**************/i...background.png
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #12
    New Coder
    Join Date
    Dec 2009
    Location
    MN
    Posts
    34
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hmm ic its a fixed size image? Resizes to any size window

    Thankyou


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •