Text Color Based on DB Value

Discussion in 'ASP General' started by Chris Stanley, Jul 27, 2005.

  1. I'm not a "blame Microsoft for everything" kind of guy. They are absolutely
    at fault for some things though. But I'm not speaking of that. I'm
    speaking of what I don't like about strict CSS. I dislike IE for honoring
    something like <span style="width: 200px;">, but at the same time, I curse
    the W3C for not making that a standard. So, in this case, my frustration is
    with CSS.

    Ray at work
     
    Ray Costanzo [MVP], Jul 28, 2005
    #21
    1. Advertisements

  2. NICE!

    Ray at work
     
    Ray Costanzo [MVP], Jul 28, 2005
    #22
    1. Advertisements

  3. Chris  Stanley

    Adrienne Guest

    I think a lot of people get unhappy with CSS because they are not using
    semantic markup in the first place. That's how we wound up with tag soup
    in the beginning, and now we have CSS soup instead.

    If you use markup that pertains to the structure of a document, there
    aren't that many places to go wrong. The example above looks like a list,
    so I would use list markup and style the elements accordingly, eg:

    ul {border:1px solid #000; list-style-type:none; padding:1em;}
    ul li {width:200px; float:left; text-align:center; border-right:1px solid
    #c0c0c0;}

    <ul>
    <li>Apples</li>
    <li>Oranges</li>
    <li style="border:0">Grapes</li>
    </ul>

    and you would come up with something like:
    Apples | Oranges | Grapes

    Of course my favorite use of CSS is to produce GreenBar tables where I have
    a colora and colorb classes defined in an external stylesheet, and this
    markup:
    <% if counter mod 2 = 0 then
    theclass = "colora"
    else
    theclass = "colorb"
    end if
    %>
    <tr class="<%=theclass%>">
    <td>data</td>
    </tr>
    <% 'continue loop and update counter %>

    external sheet:
    ..colora {background-color:#fff; color:#000;}
    ..colorb {background-color:#f0fff0; color:#000;}

    What's so great about that is consistency for the entire site. If I want
    to change it to blue bar, I just need to change the colora and colorb
    classes in the external sheet, and voila! the whole site is changed.
     
    Adrienne, Jul 29, 2005
    #23
  4. Chris  Stanley

    Adrienne Guest

    Dave, I love that signature. Do you mind if I borrow it, and change it
    slightly, maybe charge less, say $300?
     
    Adrienne, Jul 29, 2005
    #24
  5. Chris  Stanley

    Bob Lehmann Guest

    I'm not a "blame Microsoft for everything" kind of guy.
    Few of us are. But, who else would you blame for IE being 5+ years old, and
    severely out of touch?
    Why should the W3C necessarily follow IE extensions/aberrations?
    Myself, I'm upset with W3C for not making <blink> standard :>).

    Bob Lehmann
     
    Bob Lehmann, Jul 29, 2005
    #25
  6. Just make sure that you only go after the people who sent you the
    unsolicited e-mail that you actually ~read~ though. :]

    Ray at work
     
    Ray Costanzo [MVP], Jul 29, 2005
    #26
  7. Chris Hohmann, Aug 2, 2005
    #27
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.