Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2004

    Background color that ALL browsers see and recognize....

    So you have a simple table. You want it to have a certain background color. This is easily achieved of course, but with so many browsers out there, and some html code being "de-valued" (whatever that really means), what is the most fullproof way to add different background colors to tables, and be confident that everybody is seeing the same thing?

    Should you still use html code like below? (in bold)

    <table width="750" border="0" cellspacing="0" cellpadding="0" bgcolor="#0000FF">

    Should you instead use a background image; a tiny slice of the color you want?

    Should you instead use CSS?

    Please share.

  2. #2
    Join Date
    Jun 2003
    I don't see anything wrong with adding bgcolor to table tags.

    You could use css class if you wanted.

  3. #3
    in your stylesheet ...

    td#name {bgcolor: #0000FF;}

    in your css table tag add class="name"

    That should work fine
    Web hosting done right
    ██ Shared, Reseller and Dedicated web hosting
    An Easy Web Presence Company

  4. #4
    I think that is wrong what pmoduk2 has said

    either add:

    #name {bgcolor: #0000FF;}
    and place id="name" in the table's tag


    .name {bgcolor: #0000FF;}
    and place class="name" in the table's tag

  5. #5
    yea, sorry been up all night working hopefully the work I have done isn't wrong lol, time for more coffee
    Web hosting done right
    ██ Shared, Reseller and Dedicated web hosting
    An Easy Web Presence Company

  6. #6
    Join Date
    Jan 2004
    Guys, thank you very much for taking the time to reply .... but..

    I'm not looking for how to do it, or different ways to do it necessarily. What I am really asking here, is which of these methods is the most compatible way to do it. Knowing that some browsers are finicky, and some don't support certain things as well as others.

    So between regular bgcolor tags, using a background image, or css, which is going to ensure the best overall compatibility? Which is going to produce the most consistent results across the wide variety of users?

  7. #7
    easy. choose the color you like as the BG color of the table and make a 1x1px gif image with that color. then specify the image the bgsource, it will stretch of course, but since its consistent, it will just fill the table with the color you choose. and if you export it the right way, it can be a few bytes in size so doesnt effect page load times.
    IWDN - Really smart web developers... and me!
    More than any time in history mankind faces a crossroads.
    One path leads to despair and utter hopelessness, the other to total extinction.
    Let us pray that we have the wisdom to choose correctly.

  8. #8
    Join Date
    Jan 2003
    Houston, TX - Originally from UK
    Sorry chaps (pmoduk2 and flush() ) but you're both wrong. The CSS is:

    #name { background-color:#0000FF; }
    As for what browsers support it, well I think even NN4 supports CSS background colours on table cells. Course, who cares about NN4?
    Kinkamono Internet Services - The Internet. Done Right.
    Dive In...

  9. #9
    Join Date
    Apr 2004
    NJ USA
    CSS is the best, and most supported, route to go down. Don't use tiny images and tile them, they take up more memory as well as slow the site down of any scrolling. If you need a solid color, use the CSS and define a table background.

  10. #10
    I think that bgcolor (html) and background-color (css) are both good solutions and no one is better than the other.

    Just stay in the webcolors.

    You'll never get the same color in all computers, cause different monitors show different colors plus users can adjust their brightness and contrast and all those settings. There is no much you can do about this.

  11. #11
    Course, who cares about NN4?
    No one
    Web hosting done right
    ██ Shared, Reseller and Dedicated web hosting
    An Easy Web Presence Company

  12. #12
    Join Date
    Aug 2003
    After you choose the best solution, test it on Konqueror (KHTML). This one has a kinky way of displaying a site, even if in all the other browsers it looks fine
    Lorand R. Minyo
    Co-Founder @ Neveli

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts