XHTML Strict - <div class="PartInfo">

Discussion in 'HTML & Website Design' started by Matt Ridge, Sep 13, 2011.

  1. #1
    Hi everyone, sorry for a post that may of been answered a long time ago, but after reading a few posts about HTML I need help with XHTML...

    I have a DIV, which needs a class as far as I can tell, it should work.


    <p><div class="PartInfo"><input type="text" name="fullname" value="" /><input type="text" name="fullname" value="" /><input type="text" name="fullname" value="" /><input type="text" name="fullname" value="" /></div>    </p>
    Code (markup):
    Now I am pretty new at this, but I can't see why I can't get this to be XHTML strict.

    I am sorry if this is obvious, but I actually have a headache reading my books, and trying to make this work correctly.

    Any help would be greatly appreciated... Thanks.
     
    Matt Ridge, Sep 13, 2011 IP
  2. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #2
    This isn't valid html either. A <p> cannot contain a block level element, <div>.
     
    drhowarddrfine, Sep 13, 2011 IP
  3. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #3
    How should it look then, because I am obviously royally messing up somehow. Thanks in advance...
     
    Matt Ridge, Sep 13, 2011 IP
  4. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #4
    I don't know what your CSS classes are supposed to do but either remove the div or remove the p.
     
    drhowarddrfine, Sep 13, 2011 IP
  5. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #5
    I figured it out... I had to take a break and look at it again... noob mistake to say the least... got another issues which I'll post in a sec though, this one is stumping me.
     
    Matt Ridge, Sep 13, 2011 IP