Welcome to WebmasterWorld Guest from 107.20.34.173

Forum Moderators: incrediBILL

Message Too Old, No Replies

the correct tag for a background

a table background, not a body background

     

Echo_Tyme

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

10+ Year Member



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.

moltar

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

WebmasterWorld Senior Member 10+ Year Member



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">

Echo_Tyme

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

10+ Year Member



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

henry0

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

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



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

Echo_Tyme

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

10+ Year Member



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

tedster

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

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



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

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

Echo_Tyme

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

10+ Year Member



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.

tedster

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

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



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

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

 

Featured Threads

Hot Threads This Week

Hot Threads This Month