Help with validation error please....

Discussion in 'HTML & Website Design' started by chrisj, Oct 25, 2007.

  1. #1
    I tried to validate at W3c.org and got a few errors. can you help me? I've read it, but I don't get it. Can you explain what the remedy for this error would be, please? Thank you.

    "Document type does not allow element "DIV" here; missing one of "APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag.
    …e='float:left;width:47%;border:none;'><font face="Arial" color="#EE7600" size
    ✉
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>")."

    The DOC Type is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    
    <div style='float:left;width:47%;border:none;'><font face="Arial" color="#EE7600" size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/red.jpg" alt="" width="25" height="25"> <b>&nbsp;Red is great.</div>
    Code (markup):
     
    chrisj, Oct 25, 2007 IP
  2. jgjg

    jgjg Peon

    Messages:
    595
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Does the site display in Firefox, IE7 and IE6? If so, don't worry what w3c says.
     
    jgjg, Oct 25, 2007 IP
  3. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #3
    What is the div inside?

    The div can't go there if it's inside a tag it's not ment to be inside such as a paragraph or a blockquote.
     
    twistedspikes, Oct 25, 2007 IP
  4. chrisj

    chrisj Well-Known Member

    Messages:
    606
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #4
    thanks for your replies.

    My web site is centered in IE7, and aligned to the left in Firefox.

    How can it align centered in Firefox too?

    thanks.
     
    chrisj, Oct 25, 2007 IP
  5. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #5
    I'd need to see the whole site.

    URL please?

    Centering pages validly is a bit annoying I know.
     
    twistedspikes, Oct 25, 2007 IP
  6. clinton

    clinton Well-Known Member

    Messages:
    2,166
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    110
    #6
    Maybe its because you have the ....
    style='float:left;width:47%;border:none;'
    HTML:
    in side the div tag and not in the <script> tag....
     
    clinton, Oct 25, 2007 IP
  7. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #7
    don't you mean the style tag?

    Plus that wouldn't show up in the validator, thats perfectly fine to do it like that. Just not recomended. I'd recomend using a style sheet and linking to it in the head.
     
    twistedspikes, Oct 25, 2007 IP