SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Can I change the background colors in tables w/CSS?

    Hey all -

    I am planning on converting my site to CSS over tables, but I am still learning, and in the meantime I have a display problem in Firefox - (of course!)

    I have my CSS set up with the overall background color, but then it does not show the color of any of the columns in the table. It not only is messing with my design, but readability as well!

    It also seems to be over-riding my color tags for text when they are in the HTML. I thought the hierarchy allowed for for in-body over-rides....

    If you want to check it out, it is urbanfirefly.com

    Please don't laugh - good bad and ugly, it's all my coding, and I've worked HARD on it! Completely self-taught, hence my many shortcomings.

    The CSS I have come up with so far is:


    <style type="text/css">
    body {background-color: #c0ff80;}
    body{color: #000080;}
    a{color: #000080;}
    a:visited{color: #663366;}
    a:active{color: #663366;}
    p.right {text-align: right}
    p.center {text-align: center}
    p {font-family: maiandra gd}
    p {font-size: 18px}
    p.sansserif {font-family: sans-serif}
    span.highlight {background-color:yellow}
    </style>

    The tags that don't work in FF looke like this:

    <td valign="top" bgcolor="3399FF" width="125">
    <font face="maiandra gd, Verdana, Arial, sans-serif" size="2" color="ffff0f">

    Hmmm... looking at this, I just thought... would it work in IE and FF if I change it to:

    <font face="maiandra gd, Verdana, Arial, sans-serif" size="2" color="#ffff0f"> or something close?

    Thanks!

    PS - My site is NOT dynamic!! I am hoping to learn how to do that here, so not all pages are all spruced up recently, and I took the BGcolor off of the index page recently. I will put it back as soon as I get this figured out!

    If you know how I can keep the overall look of my pages and convert them to CSS, I am all ears - or eyes, or whatever!

    Gracias again!

  2. #2
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    If you're having problems with <table>'s specifically, then select them like this:

    Code:
    table {
    styles: here;
    }
    
    or
    
    table td {
    style: here;
    }
    Oh, and what's with the font tags?

  3. #3
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I got the font tags from http://www.w3schools.com/css/tryit.a...ss_font-family

    Except for the little bit of CSS I added to my web pages about 8 montha ago, this is the vast non-extent of my CSS knowledge.

    I take it they are wrong? They seem to work, but then I can get the colors to change, just like the table colors....

    As far as the table tag info, I am guessing that goes in a CSS? Any hint on what variables are acceptable? I think I need a good cheat sheet. I am actually pretty good at this stuff once I get a decent source to crib from. Hard to guess out of the blue what works though...

  4. #4
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    table td {
    background: #3399FF;
    vertical-align: top;
    width: 125px;
    font: 12px maiandra gd, Verdana, Arial, sans-serif;
    color: #ffff0f;
    }



    That should allow you to remove all inline formatting from the td and depreciated font tags.

  5. #5
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mstwntd
    table td {
    background: #3399FF;
    vertical-align: top;
    width: 125px;
    font: 12px maiandra gd, Verdana, Arial, sans-serif;
    color: #ffff0f;
    }



    That should allow you to remove all inline formatting from the td and depreciated font tags.

    mstwntd - you make it sound so simple...

    What happens when I want to change fonts, or colors or sizes or something all in one TD? With normal tags I know how to do it of course, but then FF likes to over-ride those...

    I try to cut down on the # of TD's since most of my content is all in one big table, and I have to create sub-tables for those breakdowns.

    If you can, check out this page - it is my most recently updated, so makes the most use of CSS and other features I am looking for overall, not just in the left column...
    UrbanFirefly.com/wild-divine

    I only add the arial, verdana, sans-serif for those who don't have maiandra gd, but it really messes with my look.


  6. #6
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I'll tell you in 10 hours mate, when I wake up.

  7. #7
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink

    Cool beans.

    No big hurry I guess. I just got totally depressed with my CSS after cruising around in csszengarden for awhile...

    When I took computer graphics in college it was on an Amiga 1000 maxed out with 512k memory, and the internet wasn't even known by the general public!

    Since I am asking for help on my CSS, if I am trying out SSI, do I have to include anything in the CsS for the calls? SSI is a new thing to me as well...


  8. #8
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Hi,

    No, you don't need to do anything extra in the CSS to cater for server side includes.

    So let me get this right, each td is a different division of the page; header, some little box, etc?

    If so, give each one a unique id, for example:

    <td id="box">Ahhhah mehh</td>

    And then select it in the CSS like this:

    Code:
    #box {
    font-size: 12px;
    whatever: here;
    }
    This allows you to have every cell (or table) do what you want. So long as you've given them all unique id's.

    Sorry if that's now what you're aiming for. I haven't used tables for layout.. ever.

  9. #9
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I totally envy you! Try UNLEARNING the only thing you know how to do!

    I do my HTML from gathering bits and pieces from various websites, then adapting it for my purposes, learning in the process.

    I think what you are refering to is how the center column of my events
    page is laid out, though I didn't know what the id's were used for. I am sure that wherever I picked that up from had an external CSS file. I am going to get around to that one of these days. Also doing SSI if I can, then I don't have to make myslef crazy trying to update 30 pages with every little change(I am currently NOT doing that until I figure out the overall CSS and SSI).

    Can you also make info expire with the id's? It would be really helpful on that events page since I don't update it but about every month, esp. now that I am trying to get so many other things sorted out...

    The index page is the one that is the most current, plus I just spent a couple hours today really neatening up the HTML, so you could peek at that and see how it compares. It is well documented so even though it has tables the layout should be easy for you to see. I haven't updated the CSS yet since I am still unsure how to work it fully...

    I am aiming to get one good clean template for each thing I am trying to do, but there are so many aspects, and it's hard to learn 30 simultaneous things sideways!

    BTW - My name is Nina, and I totally appreciate all the help!


  10. #10
    SitePoint Enthusiast UrbanFirefly's Avatar
    Join Date
    Mar 2005
    Location
    Chicago
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still looking for help...

    If someone would be willing to give my site a once-over and tell me if this is even the best way to go about it, I would be eternally grateful.

    If you have the skillz and the inclination, I might be willing to *pay* for working this all out for me...


    Last edited by UrbanFirefly; Mar 17, 2005 at 00:14. Reason: I type too fast, and post too quick ;)


Bookmarks

Posting Permissions

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