Warning: missing </div> Help please

I am validating my page at: http://www.classified-thailand.com using HTML Tidy validator on Firefox, plus ttp://validator.w3.org

I am told that I have a total of 9 missing </div> from the code lines below

line 72 column 1 - Warning: missing </div> ( 8 missing </div> )

line 74 column 3 - Warning: missing </div> ( 1 missing </div> )

Line 72

<div class="t"  style="width: 1200px; min-width: 1200px;"><div class="b"><div class="l"><div class="r"><div class="bl"><div class="br"><div class="tl"><div class="tr">

Line 74

<div class="page">

how to correct this ?

I tried adding 9 </div> after the code…but that just messed up my page layout :frowning:

your help appreciated :slight_smile:

Ok it not a matter of adding random closing tags.

Did you actually want 9 nested DIVs? Remember <div><div><div><div></div></div></div></div> is NOT the same as <div><div><div></div></div><div></div></div>. make sure you have paired up your tags as you intended.

This is why you need to do proper HTML BEFORE you start coding CSS. It is possible you wrote your CSS so that it works with the improper markup, so when you fix the markup the CSS no longer alies ‘properly’. gotta start from ‘scratch’

hope that helps

Hello dresden_phoenix,

thank you for your reply,

yes many nested <div>

I was looking for a solution to validate the page, or at least reduce the number of WARNINGS.

what to do ? :slight_smile:

What I was saying is that IF what you wanted was nested DIVs, and you just closed them as described then your CSS shouldn’t be affected and that it is possible that by developing your CSS around improperly closed tags, you may have created CSS that does not select the desired tags (when properly closed)… see what I mean now?

When UA’s encounter unclosed tags they make assumptions as to how you want them closed; assumptions which are not always right. Consequently this may have been misleading to you when you were coding your CSS. You may have had the RIGHT CSS for the wrong markup; by fixing the markup, you now have the wrong CSS for the right markup. You may need to go back and (at the very least) reinspect all of your selectors in your CSS to make sure they hit their targets

Hello dresden_phoenix, thank you for your reply :slight_smile:

yes I understand what you are saying, in my case I am using a pre-written script, and trying ti improve/correct code to help the sites performance/behavior.

my knowledge is limited (yet growing) so all advice is greatly appreciated :slight_smile:

Use Adobe Dreamweaver for formatting, you can easily solve the same and even will reduce chances of error in future also.

On the page http://www.classified-thailand.com there are 2 recurring Warnings that are causing most of my Validation Warnings

line 1049 column 5 - Warning: <a> discarding whitespace in URI reference

and

line 1085 column 5 - Warning: <a> escaping malformed URI reference

these occur many times on the page, could someone help me in correcting these errors please?

and if you think that these Validation Warnings are not important, do not need correcting then please give me your opinion :slight_smile:

all help, and ideas greatly appreciated :slight_smile:

line 1049:




<a href="			http://www.classified-thailand.com/22-organic-virgin-moringa-seeds-oil/details.html			"><img class="pic" id="lpic22" onmouseover="this.className='pic_over'" onmouseout="this.className='pic'" src="http://www.classified-thailand.com/images/listings/2013-09/thmb/organic_virgin_moringa_seeds_oil-1380371256-407-d_pic.jpg" alt="ORGANIC VIRGIN MORINGA SEEDS OIL" /></a>



extraneous spaces removed and formatted



<a href="http://www.classified-thailand.com/22-organic-virgin-moringa-seeds-oil/details.html">
  <img 
    class="pic" 
    id="lpic22" 
    onmouseover="this.className='pic_over'"
    onmouseout="this.className='pic'" 
    src="http://www.classified-thailand.com/images/listings/2013-09/thmb/organic_virgin_moringa_seeds_oil-1380371256-407-d_pic.jpg"
    alt="ORGANIC VIRGIN MORINGA SEEDS OIL"
  />
</a>


line 1086:



<a href="			http://www.classified-thailand.com/19-centella-asiatica-capsules/details.html			"><img class="pic" id="lpic19" onmouseover="this.className='pic_over'" onmouseout="this.className='pic'" src="http://www.classified-thailand.com/images/listings/2013-09/thmb/centella_asiatica_capsules-1380362495-267-d_pic.jpg" alt="CENTELLA ASIATICA CAPSULES" /></a>


extraneous spaces removed and formatted:



<a href="http://www.classified-thailand.com/19-centella-asiatica-capsules/details.html">
   <img
      class="pic"
      id="lpic19"
      onmouseover="this.className='pic_over'"
      onmouseout="this.className='pic'" 
      src="http://www.classified-thailand.com/images/listings/2013-09/thmb/centella_asiatica_capsules-1380362495-267-d_pic.jpg" 
      alt="CENTELLA ASIATICA CAPSULES"
   />
</a>


>>> and if you think that these Validation Warnings are not important,
>>> do not need correcting then please give me your opinion
Check and see if the links work in all the major browsers and let us know :slight_smile:

Hello John_Betong, thank you for your quick reply, and great coding repairing :slight_smile:

You will see that these coding validation errors are on listings that a member made on the site http://www.classified-thailand.com

Many health items were listed like CENTELLA ASIATICA CAPSULES

So every time a new item is listed for sale the site will create these code errors (well I think that will happen)

So how can this be prevented? What can be changed, and where to change it, so each new listing does not create validation errors?

Here is the Latest Ads HTML it seems that the validation errors are in there…maybe :slight_smile:

&lt;!-- LATEST ADS --&gt;
&lt;div id="latest"&gt;
	&lt;div class="box-heading top-box-text"&gt;&lt;div class="box-heading-left"&gt;&lt;div class="box-heading-right"&gt;{$lng.general.latest_ads}&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
	&lt;div class="box2-bottom-gray"&gt;&lt;div class="box-left"&gt;&lt;div class="box-right"&gt;&lt;div class="box-bottom-left"&gt;&lt;div class="box2-bottom-right"&gt;
                    &lt;div class="vert-box"&gt;
			{if $no_latest}
                      &lt;table width="100%" cellpadding="0" cellspacing="0"&gt;
                      {section name=loop start=0 loop=$no_latest step=1}
			{capture name=some_content assign=details_url}
			{if $seo_settings.enable_mod_rewrite}{seo-&gt;makeDetailsLink p1=`$latest[loop].id` p2=`$latest[loop].title`}{else}{$live_site}/details.php?id={$latest[loop].id}{/if}
			{/capture}
                        &lt;tr&gt;
                          &lt;td valign="middle" class="last-image"&gt;&lt;div class="box-image"&gt;
				&lt;a href="{$details_url}"&gt;&lt;img class="pic" id="lpic{$latest[loop].id}" onmouseover="this.className='pic_over'" onmouseout="this.className='pic'" src="{$live_site}/{$latest[loop].image}" alt="{if $latest[loop].image_id}{$latest[loop].title}{/if}" /&gt;&lt;/a&gt;
				{if $latest[loop].rented && $ads_settings.enable_rented}&lt;div class="rented" id="lrented{$latest[loop].id}" style="display: none;"&gt;&lt;/div&gt;{elseif $latest[loop].sold && $ads_settings.enable_sold}&lt;div class="sold" id="lsold{$latest[loop].id}" style="display: none;"&gt;&lt;/div&gt;{/if}
				&lt;/div&gt;&lt;/td&gt;
			&lt;td valign="middle"&gt;
			{if $data_set=="cars" && ($latest[loop].make || $latest[loop].model)}
			&lt;h3&gt;&lt;a href="{$details_url}"&gt;{$latest[loop].make} {$latest[loop].model}&lt;/a&gt;&lt;/h3&gt;
			{else}
			&lt;h3&gt;&lt;a href="{$details_url}"&gt;{$latest[loop].title|truncate:40:"...":false}&lt;/a&gt;&lt;/h3&gt;
			{/if}
			{$latest[loop].location_str}
			{if $ads_settings.enable_price && $latest[loop].price&gt;=0}&lt;div class="price"&gt;{$latest[loop].price_curr}&lt;/div&gt;{/if}
			&lt;div class="date"&gt;{$latest[loop].date_nice}&lt;/div&gt;
			&lt;/td&gt;&lt;/tr&gt;
                        {if $smarty.section.loop.index&lt;$no_latest-1}
                        &lt;tr&gt;
                          &lt;td colspan="2"&gt;&lt;div class="vert-separator"&gt;&lt;/div&gt;&lt;/td&gt;
                        &lt;/tr&gt;
                        {/if}
                      {/section}
                      &lt;/table&gt;
			{/if}
                    &lt;/div&gt;
	&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;!-- END LATEST ADS --&gt;

&lt;script type="text/javascript"&gt;
{literal}
$(window).load(function(){
{/literal}
{foreach from = $latest item=v}
	{if $v.rented}
	{literal}
		$("#lrented{/literal}{$v.id}{literal}").show();
		$("#lrented{/literal}{$v.id}{literal}").css({ top: $("#lpic{/literal}{$v.id}{literal}").position().top-8, left: $("#lpic{/literal}{$v.id}{literal}").position().left+ $("#lpic{/literal}{$v.id}{literal}").width()-57});
	{/literal}
	{elseif $v.sold}
	{literal}
		$("#lsold{/literal}{$v.id}{literal}").show();
		$("#lsold{/literal}{$v.id}{literal}").css({ top: $("#lpic{/literal}{$v.id}{literal}").position().top-8, left: $("#lpic{/literal}{$v.id}{literal}").position().left+ $("#lpic{/literal}{$v.id}{literal}").width()-57});
	{/literal}
	{/if}
{/foreach}
{literal}
});
{/literal}
&lt;/script&gt;

your help greatly appreciated :slight_smile:

Hi Ray,

I have spent quite a bit of time looking at your site and unable to simply remove all the errors.

No doubt you bought the script and I would be tempted to ask for the vendor’s assistance.

Hello John,

good to hear from you :slight_smile: and thank you for taking the time to look at the errors.

yes i purchased the script off someone who purchased it off someone, so the vendor does not want to know…lol

in your journey through the site if you did see any area/code that could be corrected please let me know,

all ideas greatly appreciated,

very best wishes :slight_smile: