XHTML: No more cell background images?

Thread Solved

Join Date: Jan 2005
Posts: 70
Reputation: Diode is on a distinguished road 
Solved Threads: 0
Diode's Avatar
Diode Diode is offline Offline
Junior Poster in Training

XHTML: No more cell background images?

 
0
  #1
Sep 2nd, 2008
I was just at validator.w3.org testing my site, and it found <td background='bricks.jpg'> as an invalid tag. It said Line 25, Column 29: there is no attribute "background".

I am using XHTML 1.0 Transitional.

Did they really do away with image backgrounds? I can't imagine that they'd want pages to be black and white.

Am I missing something here?

I'm making a webpage for a person, and I want it to be compliant with all browsers, so I was striving to make it XHTML compliant.

He wants a brick pattern as the background for his left ajax menu, but the validator won't let me. What's going on?

Any help is greatly appreciated.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 467
Reputation: tiger86 is an unknown quantity at this point 
Solved Threads: 10
tiger86's Avatar
tiger86 tiger86 is offline Offline
Posting Pro in Training

Re: XHTML: No more cell background images?

 
0
  #2
Sep 2nd, 2008
Hi,
I have viewed My Websites in 4 different browsers and I have never seen a problem going against that code error. I will check yours for you if you would like I wanted to add that I think they are trying to get people to use css for the backgrounds in tables instead of relying on the HTML code.
Last edited by tiger86; Sep 2nd, 2008 at 3:59 am.
If I helped you I would appreciate it if you would give me some reputation.
New Social Network in Development offline! Follow on twitter for updates!
Currently developing what should be social network 2.0 .
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 596
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 125
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Pro

Re: XHTML: No more cell background images?

 
0
  #3
Sep 2nd, 2008
In XHTML, the background and bgcolor attributes have been deprecated. This is because they can easily be implemented with css. If you want it to validate, use
  1. <td style="background-image:url(bricks.jpg)">
However, the best way to do this would be to put these sort of styles in an external stylesheet. This way, it can be cached by the browser and not retrieved repeatedly for each concurrent page that uses the style. This will not only clean up your html, but will also cut down on page load time resulting in a better experience for the user.
Lost time is never found again.
- Benjamin Franklin
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 70
Reputation: Diode is on a distinguished road 
Solved Threads: 0
Diode's Avatar
Diode Diode is offline Offline
Junior Poster in Training

Re: XHTML: No more cell background images?

 
0
  #4
Sep 2nd, 2008
Thanks for your replies. BuddyLee: I tried that in an external style sheet but it doesn't load the image on the page. Know why? Here is my tag for it:

HTML and CSS Syntax (Toggle Plain Text)
  1. TD.MAINCELL{
  2. FONT-WEIGHT: bold; FONT-SIZE: 105%; background-image: url("bricks.jpg"); BACKGROUND: white; COLOR: blue; FONT-FAMILY: "arial", sans-serif
  3. }

Thanks
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 596
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 125
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Pro

Re: XHTML: No more cell background images?

 
0
  #5
Sep 2nd, 2008
Put the background attribute before the background image. This has to do with the order the browser applies the attribute styles in. I would also try to get away from using all caps for the attributes.
  1. TD.MAINCELL{
  2. font-weight: bold;
  3. font-size: 105%;
  4. background: white;
  5. background-image: url("bricks.jpg");
  6. color: blue;
  7. font-family: "arial", sans-serif
  8. }
Lost time is never found again.
- Benjamin Franklin
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 70
Reputation: Diode is on a distinguished road 
Solved Threads: 0
Diode's Avatar
Diode Diode is offline Offline
Junior Poster in Training

Re: XHTML: No more cell background images?

 
0
  #6
Sep 3rd, 2008
Thanks for your help guys, the CSS worked.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: XHTML: No more cell background images?

 
0
  #7
Sep 5th, 2008
Originally Posted by Diode View Post
Thanks for your replies. BuddyLee: I tried that in an external style sheet but it doesn't load the image on the page. Know why? Here is my tag for it:

HTML and CSS Syntax (Toggle Plain Text)
  1. TD.MAINCELL{
  2. FONT-WEIGHT: bold; FONT-SIZE: 105%; background-image: url("bricks.jpg"); BACKGROUND: white; COLOR: blue; FONT-FAMILY: "arial", sans-serif
  3. }

Thanks
Capital letters are not allowed in styles, attributes, and tags in xhtml.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC