Welcome to WebmasterWorld Guest from 54.224.121.67

Forum Moderators: incrediBILL

Message Too Old, No Replies

the correct tag for a background

a table background, not a body background

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

Junior Member

10+ Year Member

joined:July 11, 2004
posts:89
votes: 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 Sept 24, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 18, 2003
posts:1929
votes: 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 Sept 24, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:July 11, 2004
posts:89
votes: 0


i'm gonna try that... i think it will work... ur my hero.
11:32 am on Sept 24, 2004 (gmt 0)

Senior Member from FR 

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 19, 2003
posts:4422
votes: 9


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

regards

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

Junior Member

10+ Year Member

joined:July 11, 2004
posts:89
votes: 0


well taht's only a background color, i needed an image.
4:29 pm on Sept 24, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


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

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

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

Junior Member

10+ Year Member

joined:July 11, 2004
posts:89
votes: 0


well....

<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 Sept 24, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


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

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

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members