homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

the correct tag for a background
a table background, not a body background

 4:16 am on Sep 24, 2004 (gmt 0)

Ok I thought I had my site 100% perfect... ran it through the validator.. and it hates the "background" tag in my TD elements.

<table width="750" background="/images/back.gif">

that's the one background i have... the page has a top image, a bottom image, and this middle image that repeats if there is content, when there is no comment it stops and prints the bottom image.

Problem is.. it works (on all browsers I think) but the validator at WC3 is telling me that it's not a correct attribute... Now... i've looked around but couldn't find anyone who knew this answer:

What is the correct attribute?

If you know then you are a god... Thank you for your time.



 4:22 am on Sep 24, 2004 (gmt 0)

You can use inline CSS:

<table width="750" style="background: url("/images/back.gif")">

Or define a CSS class in the header:

table.table_w_bg {
width: 750px;
background: url("/images/back.gif");

then in the html body just refer to it:

<table class="table_w_bg">


 6:19 am on Sep 24, 2004 (gmt 0)

i'm gonna try that... i think it will work... ur my hero.


 11:32 am on Sep 24, 2004 (gmt 0)

You can also use the TD
<td width="2" rowspan="5" align="center" valign="middle" bgcolor="#800000">

that one is part of site that 100% validates with W3C



 4:21 pm on Sep 24, 2004 (gmt 0)

well taht's only a background color, i needed an image.


 4:29 pm on Sep 24, 2004 (gmt 0)

You can also use the same style attribute for a <td>

<td style="background: url("/images/back.gif")">


 9:39 pm on Sep 24, 2004 (gmt 0)


<table width="750" style="background: url("/images/back.gif")">

that doesn't work... it's not showing the image at all...

and I can't use the TD tag because the image is spread across all 3 td's i have setup.

it's table, td, td, td, end.

but nothing seems to work... I dind't try out external CSS but it'll be about the same anyhow.


 10:27 pm on Sep 24, 2004 (gmt 0)

Sorry, our mistake. No quotes at all around the image path in css.

<table width="750" style="background: url(/images/back.gif)">

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved