homepage Welcome to WebmasterWorld Guest from 54.163.84.123
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Extra Div when validating but only way it works
Dreamcontest

5+ Year Member



 
Msg#: 4269142 posted 6:37 pm on Feb 18, 2011 (gmt 0)

Hi everyone the page in question is

freestuffgeek.com

There is an issue with code from a 3rd party when validating that i have attempted to contact but this post is about the 'extra' div.

I can't for the life of me figure out why this extra div is causing the problem in the validatior.

Line 516, Column 47: end tag for element "div" which is not open
</div> </div><div class="clear"></div></div>

This causes
<div id="mainy"> The green background that is through the whole top section of the site to end and then allows the bottom
<div class="pageEdge">
<div class="pageBottom">

Etc to display the footer correctly. Removing that extra </div> doesnt terminate the mainy but validates?


an extra pair of eyes would be great!

 

webprutser



 
Msg#: 4269142 posted 8:23 pm on Feb 18, 2011 (gmt 0)

Maybe thinking too simple, but the comment seems obvious to me. You open a div then close it two times, so looking to it at that way an "end tag for element "div" (is used for a tag) which is not open".

A quick count of opening and closing tags of div's in your page learns that there is an equal amount of them, but I find your code a little hard to read. Being not familiar with your intentions there seem to be "empty div's" and a lot of nested div's, so someone (like me) that is new to the code easily looses track.
Maybe validating is a matter of looking at the structure of your page.

Dreamcontest

5+ Year Member



 
Msg#: 4269142 posted 3:28 pm on Feb 19, 2011 (gmt 0)

this is a complicated template system built on outdated code yes... ive tried to go through it and find out where the extra div etc is.. but with no luck...

i hope someone else might have a glance through and see if they see it :)

SuzyUK

WebmasterWorld Senior Member suzyuk us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4269142 posted 6:58 pm on Feb 19, 2011 (gmt 0)

ive tried to go through it and find out where the extra div etc is.. but with no luck...


I've tried looking at this twice with no luck.. even I can't match all that in my head - over 2000 lines! ;)

you mention about the 3rd party code.. have you actually tested and validated this 3rd party code in a blank HTML page to prove it's actually that that is generating the wrong code? did your page validate before adding this code?

Removing that extra </div> doesn't terminate the mainy but validates?


it's because it's not mainy that's the problem..

----- much later, 3rd time lucky

a) you need to pay me lots of money for this :)

and

b) search your source for the line (it's around line 100, despite the fact the validator can't reconcile it until line 513)

<div style="padding:2px;" /> &nbsp;</div>

c) find where your template is generating that code and change it to:

<div style="padding:2px;"> &nbsp;</div>

i.e. remove the self closing "space/" from the opening tag

PS: this wasn't just a glance, that's why you now owe me lots of money! :)

Dreamcontest

5+ Year Member



 
Msg#: 4269142 posted 1:05 am on Feb 21, 2011 (gmt 0)

OMG SUZY! Suzy suzy suzy... i thank you completely!

That completely makes sense why the validator wasn't finding it... oi oi!

100% errors that remain are from the Text link ads generated code which sadly generates <TABLE> instead of <table> I emailed their support about it so hopefully they will make the code XHTML compliant.

Anyway... very much thank you again to suzyUK. You are seriously my hero :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved