简体   繁体   English

W3验证错误 - 表格背景图片 - 表示没有背景属性

[英]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:

!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... 我相信这是正确的,但W3说虽然我们在整个网站上使用了background="/images/blahblah.jpg" ,但属性背景并不存在......

The background attribute (for the table element) was an unofficial extension to HTML that never made it into the specification. background元素(对于table元素)是HTML的非官方扩展,从未使其成为规范。 Use the CSS background-image property instead. 请改用CSS background-image属性。

you should use css for styling, eg 你应该使用CSS来造型,例如

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

or better yet, use ids/classes and put the styling in an external css files. 或者更好的是,使用ids / classes并将样式放在外部css文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM