homepage Welcome to WebmasterWorld Guest from 50.17.176.149
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

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
Echo_Tyme




msg:618495
 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.

 

moltar




msg:618496
 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">

Echo_Tyme




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

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

henry0




msg:618498
 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

regards

Echo_Tyme




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

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

tedster




msg:618500
 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")">

Echo_Tyme




msg:618501
 9:39 pm on Sep 24, 2004 (gmt 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.

tedster




msg:618502
 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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved