Click to See Complete Forum and Search --> : Validation Questions


myrrh
06-08-2004, 11:16 AM
1) The validator said "there is no attribute 'BACKGROUND'"

<TD VALIGN="TOP" width="54" background="image-files/leftimage.gif">

(for reference, this line occurs a few lines below the opening <BODY>)

Do I try another DOCTYPE? The validator suggests using CSS for this attribute - any hints on how to do this?

2) The validator is picky about my apostrophes. Is there a way around having to use ' every time I want an apostrophe?

sharkey
06-08-2004, 11:20 AM
You should control all style and presentation with css as below.

.table {
background:url(leftimage.gif) #fff;
width:54px;
}

<table class="table">

try that

soccer362001
06-08-2004, 11:20 AM
EDIT: Above is much better.

myrrh
06-08-2004, 02:11 PM
Bear with me guys, I'm a little slow.

I'm not clear on how to integrate the suggested HTML into the document.

Thanks.

DaveSW
06-08-2004, 02:30 PM
maybe cos that's css...

In the head section of your document:
<style type="text/css"><!--
.table {
background: #fff url(leftimage.gif);
width:54px;
}
--> </style>

Personally I would use something other than an element name for it - something like "maintable" for instance.

myrrh
06-08-2004, 02:49 PM
I'm still missing something.

I added the <style type="text/css"><!--
.table {
background: #fff url(leftimage.gif);
width:54px;
}
--> </style>

to the head. And I've put <table class="table">

in a <TD> in place of the <TD VALIGN="TOP" width="54" background="image-files/leftimage.gif">

This is obviously wrong but I can't figure it out.

IncaWarrior
06-08-2004, 03:00 PM
you want <td class="table"> not <table class="table">

DaveSW
06-08-2004, 03:48 PM
if you want an easier way just replace your td with this one:

<TD style="width: 54px; background: url(image-files/leftimage.gif);">

you might also want:
background: #fff url(image-files/leftimage.gif) left repeat-y;

(as being other properties which can come in useful)

IncaWarrior
06-08-2004, 09:15 PM
that's not really easier and it takes up more room

DaveSW
06-09-2004, 03:01 AM
If it's only applied to one td how is one line of code longer than five?

DaveSW
06-09-2004, 03:04 AM
70 characters is shorter than 108. :D