Jump to content

W3c Validation


Nihilus

Recommended Posts

hello everyoneI published a html document and validated it on the w3c website. It returned a couple of errors and I fixed most of it. there is just 2 remaining and I don't know how to fix it. Someone PLEASE HELP!!!First error:Line 37, Column 22: there is no attribute "HEIGHT".<table height="33" align="center" background="http://xxxx/navigate-medium.jpg" width="210">Second error in the same place(line):Line 37, Column 53: there is no attribute "BACKGROUND".<table height="33" align="center" background="http://xxxx/navigate-medium.jpg" width="210">This is a navigation bar. I used a table and placed a background image to the table. I need the height attribute to correctly display the background image. They don't allow the background attribute in a table element.Here is the whole html code:<table align="center" border="0" cellpadding="0" cellspacing="0" width="210"> <tr> <td width="14"> <img alt="Border_Left" height="33" src="http://xxxx/navigate-left2.jpg"> </td> <td> <table height="33" align="center" background="http://xxxx/navigate-medium.jpg" width="210"> <tr> <td><a href="http://xxxx.html">xxxx</a></td>'>http://xxxx.html">xxxx</a></td> <td><a href="http://xxxx.html">xxxx</a> <td><a href="http://xxxx.html">xxxx</a> </tr> </table> </td> <td width="14"> <img alt="Border_Right" border="0" height="33" src="http://xxxx/navigate-right2.jpg"> </td> </tr></table>I am still a noob at html. If someone has a better idea, please tell me.Thanks.

Link to comment
Share on other sites

All those old presentational attributes have been replaced with CSS. You'll need to add a stylesheet, in the head of your document, or as a linked document. Your table definition might look like this:

<style type="text/css">	table.nav {		height: 33px;		width: 210px;		background-image: url(http://xxxx/navigate-medium.jpg);	}</style>

And the tag in the body would be like this:

<table class="nav">

Note: how text and other elements wraps around the table would be a property of the element that contains the table.Migrating to CSS is a chore at first, but it's not just the wave of the future -- it is the present. And after a few pages, you get used to it.

Link to comment
Share on other sites

hello everyoneI published a html document and validated it on the w3c website. It returned a couple of errors and I fixed most of it. there is just 2 remaining and I don't know how to fix it. Someone PLEASE HELP!!!First error:Line 37, Column 22: there is no attribute "HEIGHT".<table height="33" align="center" background="http://xxxx/navigate-medium.jpg" width="210">Second error in the same place(line):Line 37, Column 53: there is no attribute "BACKGROUND".<table height="33" align="center" background="http://xxxx/navigate-medium.jpg" width="210">This is a navigation bar. I used a table and placed a background image to the table. I need the height attribute to correctly display the background image. They don't allow the background attribute in a table element.Here is the whole html code:<table align="center" border="0" cellpadding="0" cellspacing="0" width="210"> <tr> <td width="14"> <img alt="Border_Left" height="33" src="http://xxxx/navigate-left2.jpg"> </td> <td> <table height="33" align="center" background="http://xxxx/navigate-medium.jpg" width="210"> <tr> <td><a href="http://xxxx.html">xxxx</a></td>'>http://xxxx.html">xxxx</a></td> <td><a href="http://xxxx.html">xxxx</a> <td><a href="http://xxxx.html">xxxx</a> </tr> </table> </td> <td width="14"> <img alt="Border_Right" border="0" height="33" src="http://xxxx/navigate-right2.jpg"> </td> </tr></table>I am still a noob at html. If someone has a better idea, please tell me.Thanks.
I'm guessing you have a good, valid DOCTYPE. In the current (strict) verisons, you can't use deprecated codes like height in a tag. The answer is to move the presentation (like height or align or background) to css.
Link to comment
Share on other sites

hello everyoneI published a html document and validated it on the w3c website. It returned a couple of errors and I fixed most of it. there is just 2 remaining and I don't know how to fix it. Someone PLEASE HELP!!!First error:Line 37, Column 22: there is no attribute "HEIGHT".<table height="33" align="center" background="http://xxxx/navigate-medium.jpg" width="210">Second error in the same place(line):Line 37, Column 53: there is no attribute "BACKGROUND".<table height="33" align="center" background="http://xxxx/navigate-medium.jpg" width="210">This is a navigation bar. I used a table and placed a background image to the table. I need the height attribute to correctly display the background image. They don't allow the background attribute in a table element.Here is the whole html code:<table align="center" border="0" cellpadding="0" cellspacing="0" width="210"> <tr> <td width="14"> <img alt="Border_Left" height="33" src="http://xxxx/navigate-left2.jpg"> </td> <td> <table height="33" align="center" background="http://xxxx/navigate-medium.jpg" width="210"> <tr> <td><a href="http://xxxx.html">xxxx</a></td>'>http://xxxx.html">xxxx</a></td> <td><a href="http://xxxx.html">xxxx</a> <td><a href="http://xxxx.html">xxxx</a> </tr> </table> </td> <td width="14"> <img alt="Border_Right" border="0" height="33" src="http://xxxx/navigate-right2.jpg"> </td> </tr></table>I am still a noob at html. If someone has a better idea, please tell me.Thanks.
A better way to organize your page is to use <div> instead of tables. Tables are OK for presenting tabular data, but not for organizing the page layout. The <div>s would be positioned using css.In your case you have a classic three column layout (http://bonrouge.com/3c-hf-fluid.php). Basically, a div on the left, a div on the right and stuff in the middle.Further, you have a menu which could be ul/li listing.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...