CSS to change font

Discussion in 'Javascript' started by JCO, Mar 2, 2004.

  1. JCO

    JCO Guest

    How would you modify this to include font color to be white:
    <style type="text/css">ul,ol{color:white;}</style>

    I tried this, but it did not work:
    <style type="text/css">font color="#FFFFFF",ul,ol{color:white;}</style>
    JCO, Mar 2, 2004
    #1
    1. Advertising

  2. On Tue, 02 Mar 2004 14:02:10 GMT, JCO <> wrote:

    > How would you modify this to include font color to be white:
    > <style type="text/css">ul,ol{color:white;}</style>


    CSS is off-topic in this group. Please refer style sheet questions to
    comp.infosystems.www.authoring.stylesheets in the future.

    > I tried this, but it did not work:
    > <style type="text/css">font color="#FFFFFF",ul,ol{color:white;}</style>


    That's because it's an invalid selector. Read the specification regarding
    selectors:
    http://www.w3.org/TR/REC-CSS2/selector.html

    If you're using CSS, why are you bothering with deprecated elements like
    FONT, anyway?

    Your solution would either be to use a styled SPAN element to surround
    highlighted text (which I assume is your goal):

    span.white, ul, ol {
    /*
    Make sure that an explicit background-color property
    is specified here or in an ancestor.
    */
    color: #ffffff;
    }
    ...
    <p>Some <span class="white">white</span> text</p>

    ....or to match the color attribute value in the font element:

    font, ul, ol {
    color: #ffffff;
    }

    The latter won't work in IE, due to its abysmal CSS 2 support, though it
    will render the font element. The first solution is obviously preferred.

    Mike

    --
    Michael Winter
    d (replace ".invalid" with ".uk" to reply)
    Michael Winter, Mar 2, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Karl Hungus

    Font class, external font files question

    Karl Hungus, Feb 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    511
    Karl Hungus
    Feb 4, 2004
  2. =?Utf-8?B?Tmlja3k=?=
    Replies:
    2
    Views:
    691
    Matt Berther
    Feb 20, 2005
  3. Michael Glavitsch
    Replies:
    1
    Views:
    741
    Roedy Green
    Jul 15, 2003
  4. Nick Spinel
    Replies:
    0
    Views:
    916
    Nick Spinel
    Jul 25, 2003
  5. mttc
    Replies:
    2
    Views:
    2,363
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page