SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    error while validating

    hi guys .. this is an error i got while validating:

    Validation Output: 1 Error
    Line 22, Column 8: document type does not allow element "ul" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.
    <ul>


    this is my doctype:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "w3org(i cant post it)/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    what is going on here?

    thanks in advance

  2. #2
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,271
    Mentioned
    252 Post(s)
    Tagged
    1 Thread(s)
    I think that even with the low amount of posts you have, you can post your doctype with the url because you are not doing any self-promotion of your site, and it will not be parsed as a link.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    XHTML Frameset DTD
    I can't see your code, so I assume that you haven't closed a tag properly and the validator thinks that the error is on the ul element, although very possibly is somewhere else. Very possibly, you forgot to add / at the end of a element such as img which doesn't need a closing tag but it does need the bar.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i tried to post it .. but it said i couldnt ..
    anyways this is my code:

    <body>
    <div id="mainlayer">
    <p>

    here is some information then comes:

    <ul>
    <li>Tuinontwerp</li>
    <li>Tuinaanleg</li>
    <li>Tuinonderhoud</li>
    <li>Vijversaanleg</li>
    <li>Boomverzorging</li>
    </ul>

    </p>
    </div>
    </body>

    this is the error i got:

    Line 22, Column 8: document type does not allow element "ul" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.
    <ul>

    i cant find any error ..

  4. #4
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,271
    Mentioned
    252 Post(s)
    Tagged
    1 Thread(s)
    aaaaah.... now everything is clear.... You can't put a ul inside a p element. That's why.

  5. #5
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol .. i never knew ..
    thank u ..

  6. #6
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    That would do it.

    You might consider going with HTML 4.01 Strict as a doctype instead of XHTML Transitional.

  7. #7
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,271
    Mentioned
    252 Post(s)
    Tagged
    1 Thread(s)
    XHTML is not HTML, but XML.

    There are rules about which block element can/should go inside another block element. It doesn't make sense that a list is inside a paragraph of text, among other things because the ul is a block element itself, so the elements of the list have been already wrapped. And, besides, it is not semantic...

  8. #8
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i understand .. thanks ..

  9. #9
    SitePoint Member
    Join Date
    Aug 2008
    Location
    Rugby
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup, I kept doing contact forms inside <p> tags and couldn't figure out why it wasn't validating. Unless it is text, it is probably best to close any tags before adding in a contact form or bullets etc.

  10. #10
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok .. so what can i do when i want do the following:
    a certain text like couple of lines then for example if i
    would say my services include:
    -
    -
    -

    and i dont want space between the text and the ul?

    thanks in advance

  11. #11
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ul {
    margin:0;
    padding:0;
    }

    for the <p> that comes before the ul:

    margin-bottom:0;
    padding-bottom:0;

  12. #12
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank u ..


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
  •