Free2Code
The majority of forums are now only available as archives, which means posting/editing is disabled.

The Anything and Everything forum is still open.
 
Time: 2013-05-23, 02:25am
CSS Background
Subject: CSS Background  ·  Posted: 2003-09-03, 09:08am
Rank: ? (172)
Member #: 8641
I went and ran my site layout through the W3C Validator and got alot of errors because of my tables. I've found solutions to most of the problems but I am stuck on fixing the background problem.

An example of a table in my layout is as follows:
Code:
  1. <table width="100%" border="0" background="graphics/top.gif" cellpadding="0" cellspacing="0">
  2. <tr>
  3. <td align="center">
  4. <img src="logo.gif" alt="Radical-Trends.net Logo">
  5. </td>
  6. </tr>
  7. </table>


How can I set this up using CSS?
Just a note all my tables have different backgrounds this is just one table from my layout.



-TwiztedFake-
 
  Reply to this ·  Post link ·  Top
Subject: Re: CSS Background  ·  Posted: 2003-09-03, 09:42am
Rank: ? (4827)
Member #: 3416
change background="graphics/top.gif" to style="background-image: url(graphics/top.gif);"

my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
 
  Reply to this ·  Post link ·  Top
Subject: Re: CSS Background  ·  Posted: 2003-09-03, 01:51pm
Rank: ? (172)
Member #: 8641
I used the style tag you suggested and it fixed the problem.

Is there a way to do this using an external style sheet?

Anyways I'm sure I'll have more questions as I go through the site. Never thought making it all valid html 4.01 could be so much work but should be worth it in the future. Actually its quite surprising on how much about html I really don't know even after working with for the last 2 years. LOL


Thanks for the Help!

~*~Peace~*~



-TwiztedFake-
 
  Reply to this ·  Post link ·  Top
Subject: Re: CSS Background  ·  Posted: 2003-09-04, 10:11am
Rank: ? (1045)
Member #: 2150
css reference on w3c
Look through this site and you'll see a lot of thing to use in a external stylesheet.

for background this would be something like:
Code:
  1. .someclassname {
  2. background-image: url(graphics/top.gif);
  3. }

but remember to put class="someclassname" in the <table> tag or it won't work.

"Your coding is godly, Mav. Stop watching porn and do something with your life!" -.- (Farley)
 
  Reply to this ·  Post link ·  Top
Subject: Re: CSS Background  ·  Posted: 2003-09-06, 03:22pm
Rank: ? (645)
Member #: 62
this hasnt let me down. dont know if it will help you, but good luck on what your trying to do.

Code:
  1. <STYLE type=text/css>A:link {
  2.     COLOR: #8da2ba; TEXT-DECORATION: none
  3. }
  4. A:visited {
  5.     COLOR: #8da2ba; TEXT-DECORATION: none
  6. }
  7. A:active {
  8.     COLOR: #8da2ba
  9. }
  10. A:hover {
  11.     COLOR: #8FABD0; TEXT-DECORATION: overline
  12. }
  13. BODY {
  14.     SCROLLBAR-FACE-COLOR: #163061; SCROLLBAR-HIGHLIGHT-COLOR: #163061; SCROLLBAR-SHADOW-COLOR: #8da3ba; SCROLLBAR-3DLIGHT-COLOR: #8da3ba; SCROLLBAR-ARROW-COLOR: #8da3ba; SCROLLBAR-TRACK-COLOR: #163061; SCROLLBAR-DARKSHADOW-COLOR: #163061; BACKGROUND-COLOR: #163061
  15. }
  16. </STYLE>




Because you can't starve us out and you can't make us run, Cause when them ole boy raised on shotgun. We say grace and we say ma'am, If you ain't into that we don't give a damn
 
  Reply to this ·  Post link ·  Top
Subject: Re: CSS Background  ·  Posted: 2003-09-06, 10:34pm
Rank: ? (1045)
Member #: 2150
To Other: Those scrollbar colors are not valid css, only internet explorer can do this. If you want valid html 4.01 and valid css, don't use them.

"Your coding is godly, Mav. Stop watching porn and do something with your life!" -.- (Farley)
 
  Reply to this ·  Post link ·  Top
Subject: Re: CSS Background  ·  Posted: 2003-09-19, 07:46pm
Rank: ? (187)
Member #: 8216
and I'm really not keen on all the tags and attributes in CAPS... I suspect that wont validate Looks pretty funky though! hehehe

 
  Reply to this ·  Post link ·  Top
Subject: Re: CSS Background  ·  Posted: 2003-09-20, 02:18am
Rank: ? (4827)
Member #: 3416
css might validate in caps, but xhtml will NOT validate if you use caps for tags (like STYLE). also it might not display correctly

my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

Penguino AVR

Want to learn about robotics or microcontrollers?
Check out the Penguino AVR from our friends at
Icy Labs