SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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
    Code:
    <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
    Code:
    <div class="page">
    how to correct this ?

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

    your help appreciated

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,806
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    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

  3. #3
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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 ?

  4. #4
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,806
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    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

  5. #5
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello dresden_phoenix, thank you for your reply

    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

  6. #6
    SitePoint Member
    Join Date
    Oct 2013
    Location
    India
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use Adobe Dreamweaver for formatting, you can easily solve the same and even will reduce chances of error in future also.

  7. #7
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

    all help, and ideas greatly appreciated

  8. #8
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,846
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    line 1049:
    PHP Code:


    <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
    PHP Code:

    <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:
    PHP Code:

    <a href="            [url]http://www.classified-thailand.com/19-centella-asiatica-capsules/details.html[/url]            "><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:
    PHP Code:

    <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
    Last edited by John_Betong; Oct 4, 2013 at 02:07. Reason: formatting
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  9. #9
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello John_Betong, thank you for your quick reply, and great coding repairing

    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

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

    your help greatly appreciated

  10. #10
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,846
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    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.
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  11. #11
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello John,

    good to hear from you 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


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •