Finding "unclosed element"

How do you find unclosed elements.  I'm trying to clean up code, but when I look at the source in Firefox,  the close body tag reports the following error:
End tag for "body" seen, but there were unclosed elements

This occurs on even simple pages.  I understand what the message means but how do I go about finding the "unclosed element"?  Is there an easier way to look at the source to find this error?
breeze351Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Do a view source and copy the content.
Go to an HTML Formatter service (Example: https://www.freeformatter.com/html-formatter.html) and format the HTML
Paste into an editor and save as .html (so you can get the code formatting)

No go through the code to see where you have a missing div

What I do is eliminate blocks I know are correct - so when I have an opening <ul> - when I find the closing </ul> I remove the <ul> entirely. This slowly reduces the size of the haystack.
0
Chris StanyonWebDevCommented:
I would suggest you consider using an IDE or advanced text editor that would highlight this kind of thing automatically. I use Sublime Text with a plugin, and it will highlight is an end tag is missing - works well for HTML / CSS / JS / PHP etc.
0
Julian HansenCommented:
Just a note that the editor can show you it is missing - but to find where it is supposed to go can take a bit of searching.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Chris StanyonWebDevCommented:
@Julian - Yep :)

I think that's probably why I'm slightly OCD about indentation !
1
breeze351Author Commented:
Julian:
I tried what you suggested, but no joy!  I'm attaching the html text.  It's not that big.  Maybe you can see what I'm missing.

Chris.:
I do the same thing.  Even with if statements in php.  I actually start the if statement on one line on the next line I put the "{" under the "if".  Then on the 3rd line I indent the code.  When I'm done with the if statement, the "}" aligns under the opening "{".  I know it's not what is considered correct coding, but it sure makes it easier for me to read and find errors .  I can't tell you how may times I just typed to fast and instead of "{", I typed "[" or the same on the closing brackets.
open_elem.txt
0
Chris StanyonWebDevCommented:
Hey breeze,

Don't see anything fundamentally wrong with your page. Firefox is not showing any errors in the source view, and apart from a couple of deprecated properties it validates as HTML perfectly OK.

The width on <table> and align on your Submit button should be replaced with CSS.

You're missing quotes around the class name on your first <td>

<td style="padding-left:5px" class = Body_Labels>User ID: </td>

But they're trivial issues.

Do you have any plugins enable in Firefox that injects additional code into your pages - sometimes adblockers or webdev tools can do that.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
I get the same results as Chris - no validation errors - code seems semantically correct.
0
breeze351Author Commented:
I swear to you that yesterday the </body> in the source view in Firefox said that there were open elements!
I haven't been drinking that much (Well maybe I have).
0
breeze351Author Commented:
I swear to you that yesterday the </body> in the source view in Firefox was in read and  said that there were open elements!
I haven't been drinking that much (Well maybe I have).
Thanks
0
Julian HansenCommented:
Cache maybe?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.