Nico Nicholas
Nico Nicholas

Reputation: 21

W3 Validation error - table background image - says no attribute for background

I have lots of errors on our homepage, and I'm working through the list, however there seems to be an issue that is difficult to get around...

I am using this for the doctype:

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"

Which I believe to be correct, but W3 says that the attribute background doesn't exist although we have used background="/images/blahblah.jpg" all over the site...

Upvotes: 0

Views: 948

Answers (2)

Quentin
Quentin

Reputation: 943591

The background attribute (for the table element) was an unofficial extension to HTML that never made it into the specification. Use the CSS background-image property instead.

Upvotes: 2

Sgoldy
Sgoldy

Reputation: 796

you should use css for styling, e.g.

style="background: url('...');"

or better yet, use ids/classes and put the styling in an external css files.

Upvotes: 0

Related Questions