1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Validation Error Help

Discussion in 'CSS' started by Professional Dude, Nov 30, 2009.

  1. #1
    Hi,

    I am trying to validate one of my sites and this is the error I get while validating at validator.w3.org

    and this is the code
    How can I change the code so it gets validated as XHTML 1.0 Strict!

    Thanks
     
    Professional Dude, Nov 30, 2009 IP
  2. vinpkl

    vinpkl Active Member

    Messages:
    899
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #2
    use div float to validate

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    <div style="float:right"><table width="100" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>asdfasdf asdfsa asdf asdfsadf asdf sdfas asdf sadfas sdfas dasdfsdf sfg sdfg dsfg dsfgasdfasdf asdfsa asdf asdfsadf asdf sdfas asdf sadfas sdfas dasdfsdf sfg sdfg dsfg </td>
      </tr>
    </table>
    </div>
    </body>
    </html>
    
    Code (markup):
     
    vinpkl, Dec 1, 2009 IP
    Professional Dude likes this.
  3. Professional Dude

    Professional Dude Prominent Member

    Messages:
    6,261
    Likes Received:
    430
    Best Answers:
    0
    Trophy Points:
    330
    #3
    Thanks :) , it validates perfectly after using the above code.
    Rep Added.
     
    Professional Dude, Dec 1, 2009 IP
  4. taminder

    taminder Peon

    Messages:
    581
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    make sure you define heights or float might not work, even though it will validate.
     
    taminder, Dec 1, 2009 IP
    Professional Dude likes this.
  5. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Floats don't need heights.

    Anyhoo, no reason not to just float the table itself : ) Screw the extra div.
     
    Stomme poes, Dec 4, 2009 IP
    Professional Dude likes this.