Back To Start Of Archive
Taken From The Forum: Anything Goes
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:30
Web advice needed please!
Poster: fredlongworthhighschool
Dated: Friday April 30 2004 - 14:14:10 BST
Not a Milonic issue but seeing as how the support on here is so good I thought I'd thrown in a little issue I have.
What with all these new rules from the UK Disability Rights Commission hassling web designers to make their sites fully compliant, we thought we'd couple this in with a revamp of our website.
But there is one bit of code which is coming up invalid. The error is:
Quote:
Line 42, column 29: there is no attribute "BACKGROUND" (explain...).
<TD background="../images/g_04.gif"></TD>
<TD background="../images/g_04.gif"></TD>
This image is the left hand side of a box. The odd thing is that the right hand side parses ok. The code is as follows:
Code:
40: <!-- Left & Right Edge Bars -->
41: <TR>
42: <TD background="../images/g_04.gif"></TD>
43: <TD bgColor="#FFFFFF">
44: <div align="center">
45: <p><img src="images/banners/FLHS_title.jpg" alt="FLHS title" width="600" height="128"></p>
46: <p><img src="images/schoolpic/artimp404.gif" alt="School Photo" width="405" height="223" border="0"></p>
47: <p><img src="images/banners/shapingfuture.jpg" alt="Shaping_Future logo" width="388" height="42" hspace=0 border=0 align=middle class=""> </p>
48: </div>
49: </TD>
50: <TD background="../images/g_06.gif"></TD>
51: </TR>
41: <TR>
42: <TD background="../images/g_04.gif"></TD>
43: <TD bgColor="#FFFFFF">
44: <div align="center">
45: <p><img src="images/banners/FLHS_title.jpg" alt="FLHS title" width="600" height="128"></p>
46: <p><img src="images/schoolpic/artimp404.gif" alt="School Photo" width="405" height="223" border="0"></p>
47: <p><img src="images/banners/shapingfuture.jpg" alt="Shaping_Future logo" width="388" height="42" hspace=0 border=0 align=middle class=""> </p>
48: </div>
49: </TD>
50: <TD background="../images/g_06.gif"></TD>
51: </TR>
http://www.flhs.wigan.sch.uk/test
Poster: kevin3442
Dated: Friday April 30 2004 - 18:18:30 BST
Hi Andy,
Not 100% sure, but background may be a depreciated attribute in HTML 4.0, in favor of controlling such things through CSS. Are you specifying a doctype?... that might make a difference.
Cheers,
Kevin
yup, css will do
Poster: waitman
Dated: Thursday May 13 2004 - 8:27:03 BST
Hello
Yes, you should look into CSS. Below are two example that produce similar results, the first table without CSS and the second with CSS. http://validator.w3.org/ gripes about the background attribute on the <td>, because it is indeed deprecated. I didn't try but you could probably set your DOCTYPE to something like 3.2, and the warning would dissapear.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.tdbg {
background-image: url(http://www.flhs.wigan.sch.uk/test/images/g_06.gif);
background-repeat: repeat-y;
}
</style>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="http://www.flhs.wigan.sch.uk/test/images/g_06.gif" height="150"><img src="http://www.flhs.wigan.sch.uk/test/images/g_06.gif" width="25" height="3" border="0" alt="nothing"></td>
</tr>
</table>
<br clear="all">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="tdbg" width="25" height="150"><img src="http://www.flhs.wigan.sch.uk/test/images/g_06.gif" width="25" height="3" border="0" alt="nothing"></td>
</tr>
</table>
</body>
</html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.tdbg {
background-image: url(http://www.flhs.wigan.sch.uk/test/images/g_06.gif);
background-repeat: repeat-y;
}
</style>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="http://www.flhs.wigan.sch.uk/test/images/g_06.gif" height="150"><img src="http://www.flhs.wigan.sch.uk/test/images/g_06.gif" width="25" height="3" border="0" alt="nothing"></td>
</tr>
</table>
<br clear="all">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="tdbg" width="25" height="150"><img src="http://www.flhs.wigan.sch.uk/test/images/g_06.gif" width="25" height="3" border="0" alt="nothing"></td>
</tr>
</table>
</body>
</html>
Best Regards,
Poster: fredlongworthhighschool
Dated: Friday May 14 2004 - 14:09:07 BST
Just a little update:
I've since spent a little time studying CSS boxes and you guys are right, it's far superior.
I've not had time to do much since getting it working, but my results have been uploaded http://www.flhs.org.uk/test
Thanks again,
Andy