Mysterious Stray div


I’ve been adapting a page based on another and all was well until I added something that I shouldn’t… I tried to retrace my steps but things got even worse.

The html validator is throwing an error: a stray div

I’ve used Notepad++ to check every div and could not find anything.

Then, I sought my daughter’s help and wrote down every opening an closing divs. I found (or thought I had found) some missing or extra divs but things got even worse.

Could you help, please?


…and now suddenly the page validates but it’s all over the place!

You’ve got a bunch of opening p elements you don’t close. That may be causing the validator to have fits (it’s giving my ide fits trying to close the matching elements…)

I know they’re optional, but for your own sanity (and browser stability), I’d recommend closing those p elements where appropriate.

1 Like

Ditto the <p> tags. And those goofy margins are still around.

There seems to be one too many close </div> tags in the maincontainer, too.

You’ve got an equal number of opening and closing divs in the entire document (Find ftw), and I couldn’t find any messed up ordering in a cursory scan through, but it’s definitely a bit disorganized, hard to say without a more careful look - and I’m out of here for the day :smiley:

1 Like


I sorted out a couple of <p> that were badly copied. The ones in the footer have to be changed for <br> but they worked ok in the other pages.

The stray div seems to have gone as the page now validates

The margins you mentioned in the other page will be dealt with when I get this one together. Do you have any idea what has gone wrong?

Yes, approximately.

You have a stray </div> tag on line 288.

Move it down to line 570 or thereabouts (there are lots of vacant lines).



Hi ronpat



This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.