SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Validation Error

    Hi all,

    I have recently begun updating my website to XHTML and I have encountered the following error and I am not sure what I am doing incorrectly. I have read the error comment but am unsure how to get around it. Any advice would be very welcome.

    http://www.dynamic-xchange.com/DXServices.php

    http://validator.w3.org/check?uri=ht...doctype=Inline

    Best Regards,

    Simon

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,269
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi Simon,

    Which specific errors don't you understand.

    results:


    Most of the errors are because you have wrapped your divs in p tags which is not allowed and is also a waste of html. P tags can only contain inline elements and not block elements.

    Just use the p tag without the div.

    wrong:
    Code:
                    <p>
                    <div class="serviceboxes"> <img src="images/adsXposed_Icon.gif" alt="adsXposed" /><a href="http://www.dynamic-xchange.com/DXServices/adsXposed_Personal.php" title="DXSynergy - adsXposed"> adsXposed</a> (for Webmasters)</div>
                    </p>
    right:
    Code:
                   
                    <p class="serviceboxes"> <img src="images/adsXposed_Icon.gif" alt="adsXposed" /><a href="http://www.dynamic-xchange.com/DXServices/adsXposed_Personal.php" title="DXSynergy - adsXposed"> adsXposed</a> (for Webmasters)</p>
    Divs should only be used when there is no semantic html that will do the job in hand and this is rarely the case. Divs are really just generic, non-semantic page divisions to separate the content into logical chunks.

    In reality you should never have content sitting in bare divs because there will always be a more suitable html element that will do the job better.

  3. #3
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul, I understand now.

  4. #4
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have validated most of the pages in the DXServices part of my website but I have noticed a few characters do not display properly, namely the apostrophe in words such as wholesaler's. It is displayed as wholesaler�s. Why is that exactly and how do you get around it? Surely you dont have to use &apos or &#39 everytime?

  5. #5
    SitePoint Zealot NinjaNoodles's Avatar
    Join Date
    Oct 2006
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Most likely, you typed the content in Microsoft Word, or a similar program. Simply open the file in notepad, hit Ctrl+H (replace), copy one of the non-displaying apostrophes and replace it by typing an apostrophe in the "Replace with" field.

  6. #6
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, that solved it. Thanks.


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
  •