Terve
Koodailin kaverilleni yhdenlaista laatikko systeemiä, mutta suureksi hämmästyksekseni tämä ei toimi kuin IE8:lla.
Koodi näyttää tälläiseltä:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Boxit</title> </head> <body> <table align="center" width="908" border="0" cellpadding="0" cellspacing="0"> <td width="193" valign="top" border="2"> <table align="center" width="193" border="2" cellpadding="0" cellspacing="0" bgcolor="red"> <h4>Vasen navi</h4> </table> </td><br> <td style="padding-left: 5px;" valign="top" width="516" border="2"> <table align="center" width="516" border="2" cellpadding="10" cellspacing="0" bgcolor="red"> <h4>Keskiroskat<br><br><br></h4> </table> </td> <td width="181" style="padding-left:5px;" valign="top" border="2"> <table align="center" width="193" border="2" cellpadding="0" cellspacing="0" bgcolor="red"> <h4>Oikea navi</h4> </table> </td> </table> </body> </html>
Osaako joku kertoa mikä mättää? Mielestäni tuossa ei ole mitään, minkä ei kuuluisi toimi.
Minun mielestäni siinä on 14 kohtaa jotka ei toimi.
Validation (XHTML 1.0 Transitional): Attribute 'border' is not a valid attribute of element 'td'. (rivi 8, sarake 30)
Validation (XHTML 1.0 Transitional): Element 'td' cannot be nested within element 'table'. (rivi 8, sarake 2)
Validation (XHTML 1.0 Transitional): Element 'h4' cannot be nested within element 'table'. (rivi 10, sarake 2)
Validation (XHTML 1.0 Transitional): Element 'br' cannot be nested within element 'table'. (rivi 12, sarake 7)
Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />. (rivi 12, sarake 7)
Validation (XHTML 1.0 Transitional): Attribute 'border' is not a valid attribute of element 'td'. (rivi 13, sarake 57)
Validation (XHTML 1.0 Transitional): Element 'td' cannot be nested within element 'table'. (rivi 13, sarake 2)
Validation (XHTML 1.0 Transitional): Element 'h4' cannot be nested within element 'table'. (rivi 15, sarake 2)
Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />. (rivi 15, sarake 17)
Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />. (rivi 15, sarake 21)
Validation (XHTML 1.0 Transitional): Empty elements such as 'br' must end with />. (rivi 15, sarake 25)
Validation (XHTML 1.0 Transitional): Attribute 'border' is not a valid attribute of element 'td'. (rivi 18, sarake 56)
Validation (XHTML 1.0 Transitional): Element 'td' cannot be nested within element 'table'. (rivi 18, sarake 2)
Validation (XHTML 1.0 Transitional): Element 'h4' cannot be nested within element 'table'. (rivi 20, sarake 2)
Jos tuosta nyt korjaa ihan suoranaiset virheet niin
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Boxit</title> </head> <body> <table align="center" width="908" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="193" valign="top"> <table align="center" width="193" border="2" cellpadding="0" cellspacing="0" bgcolor="red"> <tr> <td> <h4> Vasen navi</h4> </td> </tr> </table> </td> <td style="padding-left: 5px;" valign="top" width="516"> <table align="center" width="516" border="2" cellpadding="10" cellspacing="0" bgcolor="red"> <tr> <td> <h4> Keskiroskat<br /> <br /> <br /> </h4> </td> </tr> </table> </td> <td width="181" style="padding-left: 5px;" valign="top"> <table align="center" width="193" border="2" cellpadding="0" cellspacing="0" bgcolor="red"> <tr> <td> <h4> Oikea navi</h4> </td> </tr> </table> </td> </tr> </table> </body> </html>
Sitten jää enää joitakin huomautuksia:
Attribute 'align' is considered outdated. A newer construct is recommended. (rivi 7, sarake 12)
Attribute 'width' is considered outdated. A newer construct is recommended. (rivi 9, sarake 17)
Attribute 'align' is considered outdated. A newer construct is recommended. (rivi 10, sarake 24)
Attribute 'bgcolor' is considered outdated. A newer construct is recommended. (rivi 10, sarake 94)
Attribute 'width' is considered outdated. A newer construct is recommended. (rivi 19, sarake 57)
Attribute 'align' is considered outdated. A newer construct is recommended. (rivi 20, sarake 24)
Attribute 'bgcolor' is considered outdated. A newer construct is recommended. (rivi 20, sarake 95)
Attribute 'width' is considered outdated. A newer construct is recommended. (rivi 32, sarake 17)
Attribute 'align' is considered outdated. A newer construct is recommended. (rivi 33, sarake 24)
Attribute 'bgcolor' is considered outdated. A newer construct is recommended. (rivi 33, sarake 94)
Kiitos, nyt toimii :D
Vaikka toimii, kannattaa koodista silti tehdä validia (oletan siis, että copypastesit tuon korjatun version).
Aihe on jo aika vanha, joten et voi enää vastata siihen.