#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2008
    Posts
    5
    Rep Power
    0

    Question End tag for "div" omitted, but OMITTAG NO was specified.


    I am clueless as to how to fix this. Can someone help me figure this one out?

    the Validator error:
    Line 128, Column 6: end tag for "div" omitted, but OMITTAG NO was specified.

    </body>

    You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".


    Here is an info from the validator following the error:

    Line 22, Column 0: start tag was here.

    <div id="container">


    But looking at my code, there is no error?!
    I am also using a PHP include to pull html in from a menu.php (this file only has the menu code, no header, body, html tags).

    When I do the tidy html, it wants me to cut n paste the menu.php code in to the entire page, I dont want to do that but i want my code to be valid.

    Please help!
    Thanks in advance!
  2. #2
  3. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    We need to see some code if we are going to help.

    Either post a link or parse the html in a post,
    or do as the validator suggest check if every div element is closed properly.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Michigan, USA
    Posts
    278
    Rep Power
    17
    Originally Posted by vmethod

    Here is an info from the validator following the error:

    Line 22, Column 0: start tag was here.

    <div id="container">
    Thanks in advance!
    You didn't close the div with a </div> or you closed another tag before closing this one like this:

    Code:
    <p><span>text</p></span>
    The above is a no-no, you need to close the span before closing the paragraph
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2008
    Posts
    5
    Rep Power
    0
    it worked out...

    i went through it and tracked all my <div></div> which was odd because each <div> was closed with </div> but for sh**s and giggles, i added another </div> at the very end and wouldn't you know...


    thanks! even though i'm still a little confused lol.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Location
    San Antonio, TX USA
    Posts
    6
    Rep Power
    0

    end tag for "div" omitted, but OMITTAG NO was specified


    I too have the same problem. Tried adding extra closing div tag. Just created more errors. So I started removing closing div from the bottom up and got 2 errors saying exactly the opposite thing for the same line that contains only 1 closing div tag!

    line 285 end tag for "div" omitted ...
    line 285 end tag for "div" which is not open ...


    go figure.
  10. #6
  11. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,126
    Rep Power
    4304
    Welcome to DevShed Forums, RodmanB.

    To quote Akh's post above...
    Originally Posted by Akh
    We need to see some code if we are going to help.

    Either post a link or parse the html in a post,
    or do as the validator suggest check if every div element is closed properly.
    New users are restricted from posting URLs until they have made 5 posts. You may need to get around this by leaving out the "http://" and putting a space before each ".". Yes this rule is annoying, but the administrators say it's necessary for limiting spam.

    P.S. Next time please start your own thread instead of reviving a very old thread.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Location
    San Antonio, TX USA
    Posts
    6
    Rep Power
    0

    code link


    OK, sorry for any violations I may have committed. It was more a comment and less a request for an answer. I've already spent 15+ years building and debugging websites and can live with a minor anomaly. However, if you want to see the source, it's at crowderradiator. Sometime fresh eyes will catch something I may have inadvertently overlooked.

    Thank for the reply
  14. #8
  15. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,126
    Rep Power
    4304
    The HTML Validator extension for Firefox indicates that a space is missing between the href and title attributes of the first link on that page.

    Using the count sub-feature of the search feature in my text editor, I see that the number of <div> start and end tags is not equal. This is a case though where the validator isn't very good at pinpointing where the error is. By looking at the DOM structure, using Firefox's Firebug extension, I see that the end tag for the "headMast" <div> is missing.

    By the way, the hspace, vspace, border, and align attributes for <img> elements are obsolete. For the first two, CSS margins should be used instead. For the third, CSS border properties should be used. The fourth is a little trickier to replace with CSS because it depends on which value is used.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Location
    San Antonio, TX USA
    Posts
    6
    Rep Power
    0

    Old School - goes back to school


    Originally Posted by Kravvitz
    The HTML Validator extension for Firefox indicates that a space is missing between the href and title attributes of the first link on that page.

    Using the count sub-feature of the search feature in my text editor, I see that the number of <div> start and end tags is not equal. This is a case though where the validator isn't very good at pinpointing where the error is. By looking at the DOM structure, using Firefox's Firebug extension, I see that the end tag for the "headMast" <div> is missing.

    By the way, the hspace, vspace, border, and align attributes for <img> elements are obsolete. For the first two, CSS margins should be used instead. For the third, CSS border properties should be used. The fourth is a little trickier to replace with CSS because it depends on which value is used.
    ***FIXED***
    It was actually the "corral" div that was missing.

    I found it by cleaning up the code indents and aligning the opening and closing tags. Maybe 'old school' but it's easier than trying to figure what the 'Validator' was trying to say.

    As for the obsolete elements well, I guess I should clean up my code snippets. Unfortunately, production schedules sometimes forces us to recycle obsolete code. As soon I get time I'll take your suggestions. In fact, I probably should be doing that instead of this.

    Thanks

IMN logo majestic logo threadwatch logo seochat tools logo