Re: W3 Validation

Carole Lawrence wrote:
> I have tried this statement in CSS
> table { background-image: url('images/PARCHMNT.GIF') }
> 
> The folder images is at the same level as index.html. This statement 
> creates a background image for everything however, not just tables.

No, it does just apply the background to tables.  It just so happens 
that you have, in fact, used tables for everything.

> Is there a way to achieve the same as the (non-standard) way of the statement:
> <table background="... .jpg"> ?

Presumably, by your above statment, you only wish for the background to 
apply to a specific class of table, which may be accomplished through 
the use of the class attribute (eg. <table class="data"> or some other 
applicable semantic name) and using the class selector in your css:

.data { background: url(images/PARCHMNT.GIF); }

(Note: Neither single or double quotes are required for the url() 
function in CSS)

Alternatively, you could cease using tables for layout, and only where 
the content is structurally and semantically tabular.  Doing so may also 
remove the need to use a special class to select the tables you wish to 
apply the background to.

-- 
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/    Rediscover the Web
http://SpreadFirefox.com/   Igniting the Web

Received on Wednesday, 12 January 2005 07:56:42 UTC