Override Font tag

Discussion in 'HTML' started by Chris, Jun 26, 2006.

  1. Chris

    Chris Guest

    I have inherited a CMS system which allows users to format content
    themselves. Much of the formatting is done using font tags. I want to be
    able to convert some of the pages to be more accessible to disabled users.
    Is there any I can do to override the font tag via css? I have been playing
    around with the inherit feature but of css but IE 6 doesn't seem to
    recognise it. Am I doing something wrong or is it not supported? Ideally I
    want a solution that is v.4 upwards compatible. Any ideas, regards, Chris.
    Chris, Jun 26, 2006
    #1
    1. Advertising

  2. Chris

    Martin Jay Guest

    In message <>, Chris
    <> writes
    >I have inherited a CMS system which allows users to format content
    >themselves. Much of the formatting is done using font tags. I want to be
    >able to convert some of the pages to be more accessible to disabled users.
    >Is there any I can do to override the font tag via css? I have been playing
    >around with the inherit feature but of css but IE 6 doesn't seem to
    >recognise it. Am I doing something wrong or is it not supported? Ideally I
    >want a solution that is v.4 upwards compatible. Any ideas, regards, Chris.


    An interesting problem.

    The following displays "Hello there!" using the Arial font in red:

    <p><font color="#FF0000" face="Arial">Hello there!</font></p>

    Adding the following CSS overrides those settings and displays it in
    green Verdana:

    font{
    font: Verdana;
    color: Green;
    }

    So, perhaps you could explicitly set the font element so that it
    displays how you want it to, maybe the same as the body element.

    Or... Presumably the CMS content is stored in some sort of database.
    Perhaps you could cleanse it of unwanted tags, or modify the script that
    displays CMS entries to strips tags before they are sent to the browser.
    --
    Martin Jay
    Phone/SMS: +44 7740 191877
    Fax: +44 870 915 2124
    Martin Jay, Jun 26, 2006
    #2
    1. Advertising

  3. Chris

    Toby Inkster Guest

    Chris wrote:

    > I have inherited a CMS system which allows users to format content
    > themselves. Much of the formatting is done using font tags.


    I'd use a bit of server-side processing to strip them out. If you're using
    PHP there is a strip_tags() function which can strip out HTML from a
    string. (You can provide a list of tags which it should leave alone.)

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Jun 27, 2006
    #3
  4. Chris

    jojo Guest

    Chris schrieb:
    > I have inherited a CMS system which allows users to format content
    > themselves. Much of the formatting is done using font tags. I want to be
    > able to convert some of the pages to be more accessible to disabled users.
    > Is there any I can do to override the font tag via css? I have been playing
    > around with the inherit feature but of css but IE 6 doesn't seem to
    > recognise it. Am I doing something wrong or is it not supported? Ideally I
    > want a solution that is v.4 upwards compatible. Any ideas, regards, Chris.
    >
    >

    ASFAIK their is a order in which color, formats, font-style and so on
    are used:

    Specified by style-Attribut
    Specified by font-tag
    Specified in internal Stylesheets
    Specified in external Stylesheets

    To override any specification which is above in the list with any which
    below add a !important to that style.
    Example:

    font{
    font: Verdana;!important
    color: Green;!important
    }
    jojo, Jun 27, 2006
    #4
  5. Chris

    Andy Dingley Guest

    jojo wrote:

    > ASFAIK their is a order in which color, formats, font-style and so on
    > are used:


    There's no "order" in CSS. Instead there is a cascade, with specificity
    rules and calculations. This needn't give rise to a simple linear order
    in all cases, it's more complex than that.

    > Specified by style-Attribut
    > Specified by font-tag
    > Specified in internal Stylesheets
    > Specified in external Stylesheets


    As you describe it here, <font> (and some other HTML presentational
    information) gets treated as lower than the stylesheets too. A browser
    can also ignore them entirely, should it wish to (i.e. a pure CSS
    browser).

    Here's the ref:
    http://www.w3.org/TR/CSS21/cascade.html#q13

    "The UA may choose to honor presentational attributes in an HTML source
    document. If so, these attributes are translated to the corresponding
    CSS rules with specificity equal to 0, and are treated as if they were
    inserted at the start of the author style sheet."
    Andy Dingley, Jun 27, 2006
    #5
  6. Chris

    jojo Guest

    Andy Dingley <> schrieb:
    > jojo wrote:
    >
    >> ASFAIK their is a order in which color, formats, font-style and so on
    >> are used:

    >
    > There's no "order" in CSS. Instead there is a cascade, with specificity
    > rules and calculations. This needn't give rise to a simple linear order
    > in all cases, it's more complex than that.
    >
    >> Specified by style-Attribut
    >> Specified by font-tag
    >> Specified in internal Stylesheets
    >> Specified in external Stylesheets

    >
    > As you describe it here, <font> (and some other HTML presentational
    > information) gets treated as lower than the stylesheets too. A browser
    > can also ignore them entirely, should it wish to (i.e. a pure CSS
    > browser).
    >
    > Here's the ref:
    > http://www.w3.org/TR/CSS21/cascade.html#q13
    >
    > "The UA may choose to honor presentational attributes in an HTML source
    > document. If so, these attributes are translated to the corresponding
    > CSS rules with specificity equal to 0, and are treated as if they were
    > inserted at the start of the author style sheet."
    >


    Thanks, I didn't know it exactly.
    But still: if some css-layout is not used I would try to make it
    !important...
    jojo, Jun 27, 2006
    #6
  7. Chris

    Andy Dingley Guest

    jojo wrote:

    > Thanks, I didn't know it exactly.
    > But still: if some css-layout is not used I would try to make it
    > !important...


    Why not sacrifice a chicken to it? (or shoot a bear)

    If it's not working, then it's not working for a different reason.
    Doing something inappropriate isn't going to change that.
    Andy Dingley, Jun 27, 2006
    #7
  8. Chris

    jojo Guest

    >> Thanks, I didn't know it exactly.
    >> But still: if some css-layout is not used I would try to make it
    >> !important...

    >
    > Why not sacrifice a chicken to it? (or shoot a bear)
    >
    > If it's not working, then it's not working for a different reason.
    > Doing something inappropriate isn't going to change that.
    >

    I cannot remember you had a different solution that works...
    So Tell me if you found one or just don't post anything...
    And if I remember correctly you said:

    > A browser can also ignore them entirely, should it wish to (i.e. a pure CSS
    > browser).


    It *can* but it must not. So at least give !important a try, sometimes
    it can move mountains (a german saying).
    jojo, Jun 27, 2006
    #8
  9. Chris

    Andy Dingley Guest

    jojo wrote:

    > >> But still: if some css-layout is not used I would try to make it
    > >> !important...


    > I cannot remember you had a different solution that works...


    Of course. Simply use the CSS - it will over-ride <font> quite happily
    without needing !important

    If this doesn't work, then the fault is elsewhere. Fooling blindly with
    !important won't fix it.

    > > A browser can also ignore them entirely, should it wish to (i.e. a pure CSS
    > > browser).

    >
    > It *can* but it must not.


    No, that's untrue. It may ignore them (RFC2119 applies). The "must not"
    condition does not apply.
    Andy Dingley, Jun 27, 2006
    #9
  10. Chris

    jojo Guest

    Andy Dingley <> schrieb:
    > jojo wrote:
    >
    >>>> But still: if some css-layout is not used I would try to make it
    >>>> !important...

    >
    >> I cannot remember you had a different solution that works...

    >
    > Of course. Simply use the CSS - it will over-ride <font> quite happily
    > without needing !important
    >

    I think *this* is exactly what Chris had tried, right?
    jojo, Jul 2, 2006
    #10
  11. Chris

    Andy Dingley Guest

    On Sun, 02 Jul 2006 13:25:06 +0200, jojo <> wrote:

    >> Of course. Simply use the CSS - it will over-ride <font> quite happily
    >> without needing !important
    >>

    >I think *this* is exactly what Chris had tried, right?


    "I have been playing around with the inherit feature [...] of css but IE
    6 doesn't seem to recognise it."

    So that's a No
    Andy Dingley, Jul 3, 2006
    #11
    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. =?Utf-8?B?Tmlja3k=?=
    Replies:
    2
    Views:
    708
    Matt Berther
    Feb 20, 2005
  2. SuperChuck
    Replies:
    3
    Views:
    4,088
    Sandip Chitale
    Aug 7, 2003
  3. shruds
    Replies:
    1
    Views:
    783
    John C. Bollinger
    Jan 27, 2006
  4. =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=

    override default disabled font color

    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=, Jul 2, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,093
    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=
    Jul 2, 2007
  5. mttc
    Replies:
    2
    Views:
    2,386
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page