Jump to content

4 errors when trying to validate


animecosmo

Recommended Posts

I'm trying to validate my index page for xhtml first, then move onto my layout coding (head.php, footer.php, style.css pages). I figure the index page is the easiest, so the best to learn on. However, even after following the w3s school tutorials, I am having some problems using http://validator.w3.org/Full Page Coding

<!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html>        <head><title>Anime Cosmo</title><link rel="shortcut icon" href="favicon.ico" /><link rel="stylesheet" href="style2.css" type="text/css" /></head><body><table align="center" border="0" width="700"><tr><td colspan="5" align="center"><a href="http://www.tsukiyo.org/Anime/homeinclude.php"><img src="http://www.tsukiyo.org/images/indextop.jpg" border="0" id="banner" /></a></td></tr><tr><td colspan="5" align="center"><b>Choose your layout or click on the banner above to go to the default layout</b></td></tr><tr><td valign="top" align="center"><a href="http://www.tsukiyo.org/skins/index2.php?newskin=3"><img src="http://www.tsukiyo.org/images/songstress.gif" border="0" id="Songstress" /></a></td><td valign="top" align="center"><a href="http://www.tsukiyo.org/skins/index2.php?newskin=2"><img src="http://www.tsukiyo.org/images/sunflower.gif" border="0" id="Sunflower" /></a></td><td valign="top" align="center"><a href="http://www.tsukiyo.org/skins/index2.php?newskin=1"><img src="http://www.tsukiyo.org/images/vampire.gif" border="0" id="Vampire" /></a></td><td valign="top" align="center"><a href="http://www.tsukiyo.org/skins/index2.php?newskin=4"><img src="http://www.tsukiyo.org/images/fast.gif" border="0" id="Fast" /></a></td><td valign="top" align="center"><a href="http://www.tsukiyo.org/Forum/index.php"><img src="http://www.tsukiyo.org/images/forum.gif" border="0" id="Forum" /></a></td></tr><tr><td valign="top" align="center"><a href="http://www.tsukiyo.org/skins/index2.php?newskin=3">Songstress</a><br />Most browsers</td><td valign="top" align="center"><a href="http://www.tsukiyo.org/skins/index2.php?newskin=2">Sunshine</a><br />Most browsers</td><td valign="top" align="center"><a href="http://www.tsukiyo.org/skins/index2.php?newskin=1">Vampire</a><br />Netscape/Firefox</td><td valign="top" align="center"><a href="http://www.tsukiyo.org/skins/index2.php?newskin=4">Fast</a><br />Most browsers<br />Good for slow<br />modems</td><td valign="top" align="center"><a href="http://www.tsukiyo.org/Forum/index.php">Forum</a><br />Visit our forum!</td></tr><tr><td colspan="5" align="center"><b>Requirements for all versions: 800x600, tables, PHP, CSS</b></td></tr><tr><td colspan="5" align="center"><p class="center"><script type="text/javascript" lang="javascript">var sc_project=1123357; var sc_invisible=0; var sc_partition=10; var sc_security="8a8034e2"; var sc_text=4; </script><script type="text/javascript" lang="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img  src="http://c11.statcounter.com/counter.php?sc_project=1123357&java=0&security=8a8034e2&invisible=0" alt="free invisible hit counter" border="0"></a> </noscript><a href="http://my.statcounter.com/project/standard/stats.php?project_id=1123357&guest=1">Hits since 12.01.06</a></p></td></tr><tr><td colspan="5" align="center"><script type="text/javascript" src="http://ss.webring.com/navbar?f=j;y=argentnox;u=10146995"></script><noscript><table align="center"  cellspacing="0" border="2"><tr><td><table cellpadding="2" cellspacing="0" border="0"><tr><td align="center">This site is a member of WebRing. < /br>To browse visit <a href="http://ss.webring.com/navbar?f=l;y=argentnox;u=10146995">Here</a>.</font></td></tr></table></td></tr></table></noscript></td></tr></table></body></html>

Specific ProblemsNo Character Encoding Found! Falling back to UTF-8.I tried putting in the character encoding as was suggested by the validator, but no matter what I did, it kept showing up with this. What code snippet do I need to put in, and where?Line 15 column 13: there is no attribute "align".

<table align="center" border="0" width="700">

What do I use to align the table to center?Line 16 column 151: there is no attribute "border".

...kiyo.org/images/indextop.jpg" border="0" id="banner" alt="banner" /></a></td>

What do I use to define border width if not "border"?Line 41 column 58: there is no attribute "language".

<p class="center"><script type="text/javascript" language="javascript">

I tried putting in "lang" as I think it was telling me to do in the tutorial, but then it just said there was no "lang" attribute.

Link to comment
Share on other sites

You are using the XHTML 1.0 Strict DTD. This means that many things are not allowed, that are allowed in the Transitional DTD.Instead of using the align attribute on the table, use style to set the text aligment. Same for border attribute, use style to define borders.You will find the same is true for the <center> tag that people often used - it isn't allowed in XTHML Strict.As far as the language attribute. It isn't part of the standard, and isn't allowed in XHTML Strict - remove it.Your other choice is to change to the Transitional DTD.As far as character encoding... add a meta tag to your <head> that looks something like this

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

I use utf-8, but you can put your encoding of choice instead...

Link to comment
Share on other sites

Thank you very much! I set it to transitional because different tables have far different alignments thoughout my site, so I don't want a million style attributes per layout. The index page now passes, thanks to your help. Now to start working on the layouts. I'm sure I'll be back with more questions. LOL.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...