www.webdeveloper.com
Page 1 of 3 123 LastLast
Results 1 to 15 of 34

Thread: xhtml/css validation error

  1. #1
    Join Date
    Sep 2004
    Posts
    219

    xhtml/css validation error

    would someone help me with this and why this error is happening please?

    thanx, Chris

    Line 158, column 31: document type does not allow element "hr" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    <label class="linelabel"> <hr/> </label>

  2. #2
    Join Date
    Feb 2003
    Location
    Wales, UK
    Posts
    3,147
    you should have a space before your / in the hr tag, but maybe you just aren't supposed to put hr tags into label tags - have you tried using border-top and display:block instead?

  3. #3
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    Originally posted by DaveSW
    you should have a space before your / in the hr tag
    What makes you say that?

    Calav, I think you're also missing a "for" attribute on your label tag. You're only supposed to omit it if you put the input element inside the label.
    Last edited by David Harrison; 11-15-2004 at 09:33 AM.
    Every fight is a food fight when you’re a cannibal.

  4. #4
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Block inside an inline?

  5. #5
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Originally posted by lavalamp
    What makes you say that?
    XHTML 1.0 - HTML Compatibility Guidelines

  6. #6
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,277
    Originally posted by Paul Jr
    XHTML 1.0 - HTML Compatibility Guidelines
    Yes but omitting that space will not trip up the validator as it is perfectly valid. There are lots of ways to make a valid XHTML page that doesn't work which is why one ought not to use XHTML, not on the web that is.

  7. #7
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Originally posted by Charles
    Yes but omitting that space will not trip up the validator as it is perfectly valid. There are lots of ways to make a valid XHTML page that doesn't work which is why one ought not to use XHTML, not on the web that is.
    Exactly. It won't trip up the validator, but it may trip up some browsers.

  8. #8
    Join Date
    Sep 2004
    Posts
    219
    hi guys, thanx for your replies.

    i have tried taking the space out.
    taking it out of the <label> tags.
    add for =

    and nothing changes.

    anyone know what i am doing wrong or is this correct and something else above it is wrong.

    thanx, Chris

  9. #9
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,277
    Ray has is right. The LABEL element cannot contain block level elements and the HR element is block level. See http://www.w3.org/TR/html401/interac...tml#edef-LABEL .

  10. #10
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    The label element is for labelling form fields, I wouldn't have thought that a horizontal rule would be a very good label. Why do you have it in there in the first place?
    Every fight is a food fight when you’re a cannibal.

  11. #11
    Join Date
    Sep 2004
    Posts
    219
    hey guys, thanx for your replies, thats what i wanted to hear not allowed in label element.

    so i took the labels out and just left the <hr /> and it still gives me the same error!

    would it be errors above the <hr /> taht is giving me teh error?

  12. #12
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,277
    Please post the URL.

  13. #13
    Join Date
    Sep 2004
    Posts
    219

  14. #14
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,277
    There is no HR element on that page. I do see a different error, P elements cannot contain TABLE or other block elements. And I do note that you don't have a very firm grasp of XHTML (see http://www.w3.org/TR/xhtml1/#guidelines). But I wonder, Why are you using XHTML? Of XHTML 1.0 Transitional, XHTML 1.0 Strict, HTML 4.01 Transitional and HTML 4.01 Strict, XHTML 1.0 Transitional will work on the fewest browsers while HTML 4.01 Strict will work on all browsers.

  15. #15
    Join Date
    Sep 2004
    Posts
    219
    very sorry, gave you the wrong link, my bad!

    http://www.modelaircraft.co.nz/commercial.php

    thanx for the other error tip was getting to that after these errors!

    can you have a look now Charles please about the hr error?
    Last edited by Css_Calav; 11-17-2004 at 05:57 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles