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 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    Maryland, USA
    Posts
    165
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Validation Error: end tag for element "div" which is not open

    Hello,

    I've got a few pages on my web site that aren't working properly. The appearance is broken. The W3 validator informs me that:

    "end tag for element "div" which is not open" occurs on various lines.

    To me, this indicates that there must be an extra </div> tag accidentally inserted somewhere, but I can't find it.

    Is there anything else that could be causing this?

    I'm comparing working pages vs broken pages and can't identify the difference.

    Here's a few broken pages:
    http://grasmickwebdesign.com/no-craw...ons/contact-us
    http://grasmickwebdesign.com/no-craw...tions/about-us

    And a few working ones:
    http://grasmickwebdesign.com/no-craw...ffice_property
    http://grasmickwebdesign.com/no-craw...2-howards-loop

    I can't figure out what's wrong. Any help would be appreciated! Thanks!

  • #2
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    Holy hurricane of CSS links, Batman.

    In other news, the validator gives you the complete line where error occurs, which should help you locate it in the HTML document.

    One utility that might be helpful is HTML Tidy. Run your HTML through there and examine the output. It's been helpful to me in the past in locating hard-to-find tags. If nothing else, it will nest your code properly for you so you can match up opening and closing tags easier.
    matt | design | blog

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Location
    Maryland, USA
    Posts
    165
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Thanks. I am using the validator's line specific information and running through line by line in dreamweaver, but it's still a bit of a mystery.

    I says that, for instance, that div #main closed on line 389 is not open:
    Code:
    "Line 389, Column 16: end tag for element "div" which is not open
    
              </div> <!-- /main -->"
    Which means to me that it was accidentally closed earlier, but this information doesn't help me find the stray tag that's accidentally closing #main.

    Everything seems to match up perfectly in Dreamweaver...

  • #4
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    Quote Originally Posted by madmatter23 View Post
    Thanks. I am using the validator's line specific information and running through line by line in dreamweaver, but it's still a bit of a mystery.

    I says that, for instance, that div #main closed on line 389 is not open:
    Code:
    "Line 389, Column 16: end tag for element "div" which is not open
    
              </div> <!-- /main -->"
    Which means to me that it was accidentally closed earlier, but this information doesn't help me find the stray tag that's accidentally closing #main.
    Understood. This is an instance where properly-tabbed HTML would help you match up opening and closing tags, which would show you exactly where the extra tag is. HTML Tidy will clean up your HTML and tab it for you to make this easier.

    Quote Originally Posted by madmatter23 View Post
    Everything seems to match up perfectly in Dreamweaver...
    Unfortunately, as you're discovering, DW is far from the "real world" of the web.
    matt | design | blog

  • #5
    Regular Coder
    Join Date
    Jun 2007
    Location
    Maryland, USA
    Posts
    165
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Hm.. seems to match up correctly in HTML tidy as well... HTML tidy displays the same validator error, but there's no improperly indented div tags. I can't figure out what I'm missing.

  • #6
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    Quote Originally Posted by madmatter23 View Post
    Hm.. seems to match up correctly in HTML tidy as well... HTML tidy displays the same validator error, but there's no improperly indented div tags. I can't figure out what I'm missing.
    Are we seeing the same thing? I go to your first link:

    http://grasmickwebdesign.com/no-craw...ons/contact-us

    view source, copy everything and paste it into HTML Tidy. HTML Tidy outputs the code properly indented and automatically drops the extra </div> tags. Have you tried taking the HTML Tidy output and comparing it to the "uncorrected" code to see if the way the page looks in the browser window has changed? If the layouts are the same before and after, then you simply had a couple extra </div> tags which the browser ignored when it parsed the HTML.
    matt | design | blog


  •  

    Posting Permissions

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