Why doesn't !important work here?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • brett

    Why doesn't !important work here?

    Why doesn't the red color override the gray in this example:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled </title>
    </head>

    <body>
    <font color="#FF0000" style="color: Red !important;"><F ONT
    color="#E0E0E0" size=4>SIGN UP FOR FREE TODAY - bad link
    02/22/05</FONT></font>
    </body>
    </html>

    Thanks,
    Brett

  • Steve Pugh

    #2
    Re: Why doesn't !important work here?

    "brett" <account@cygen. com> wrote:
    [color=blue]
    >Why doesn't the red color override the gray in this example:[/color]

    Why should it? !important places the relevant rule higher up in the
    cascade, it does not turn off inheritence.
    [color=blue]
    ><font color="#FF0000" style="color: Red !important;"><F ONT
    > color="#E0E0E0" size=4>SIGN UP FOR FREE TODAY - bad link
    > 02/22/05</FONT></font>[/color]

    What horrible code.

    strong {color: red; background: white; font-size: larger; font-weight:
    normal;}

    <strong>SIGN UP FOR FREE TODAY - bad link 02/22/05</strong>

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

    Comment

    • Steve Pugh

      #3
      Re: Why doesn't !important work here?

      Steve Pugh <steve@pugh.net > wrote:[color=blue]
      >"brett" <account@cygen. com> wrote:
      >[color=green]
      >>Why doesn't the red color override the gray in this example:[/color]
      >
      >Why should it? !important places the relevant rule higher up in the
      >cascade, it does not turn off inheritence.[/color]

      I don't mean turn off inheritence, do I? I mean it doesn't create some
      sort of super-inheritence.

      Steve

      --
      "My theories appal you, my heresies outrage you,
      I never answer letters and you don't like my tie." - The Doctor

      Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

      Comment

      • Lauri Raittila

        #4
        Re: Why doesn't !important work here?

        in comp.infosystem s.www.authoring.stylesheets, brett wrote:[color=blue]
        > Why doesn't the red color override the gray in this example:[/color]

        URL? Browser?

        Answer: you tested using broken browser. Important is not even needed. Do
        not use transitional with CSS if you ant to get correct results using
        broken browsers.


        --
        Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
        Utrecht, NL.

        Comment

        • Christoph Paeper

          #5
          Re: Why doesn't !important work here?

          *Steve Pugh* <steve@pugh.net >:[color=blue]
          >
          > strong {color: red; background: white; font-size: larger; font-weight:
          > normal;}
          >
          > <strong>SIGN UP FOR FREE TODAY - bad link 02/22/05</strong>[/color]

          Or even:

          strong {color: red; background: white;
          font-weight: normal; font-size: larger;/*¹*/}
          strong em {text-transform: uppercase;}

          <strong><em>Sig n up for free today</em> – bad link 22 Feb. 05</strong>

          ¹ It makes sense to order the properties this way in case you would ever
          want to change to using the 'font' shorthand.

          --
          It's so simple to be wise. Just think of
          something stupid to say and say the opposite.

          Comment

          • Steve Pugh

            #6
            Re: Why doesn't !important work here?

            Christoph Paeper <christoph.paep er@nurfuerspam. de> wrote:
            [color=blue]
            > strong em {text-transform: uppercase;}[/color]

            If replicating the original you's need font-style: normal in the em
            rule as well.

            Steve

            --
            "My theories appal you, my heresies outrage you,
            I never answer letters and you don't like my tie." - The Doctor

            Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

            Comment

            • Richard

              #7
              Re: Why doesn't !important work here?

              On 25 Feb 2005 08:22:26 -0800 brett wrote:
              [color=blue]
              > Why doesn't the red color override the gray in this example:[/color]
              [color=blue]
              > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
              > <html>
              > <head>
              > <title>Untitled </title>
              > </head>[/color]
              [color=blue]
              > <body>
              > <font color="#FF0000" style="color: Red !important;"><F ONT
              > color="#E0E0E0" size=4>SIGN UP FOR FREE TODAY - bad link
              > 02/22/05</FONT></font>
              > </body>
              > </html>[/color]
              [color=blue]
              > Thanks,
              > Brett[/color]



              <font-color:#FF0000;>
              <font size="4">
              <font-size:4;>



              Comment

              • Steve Pugh

                #8
                Re: Why doesn't !important work here?

                "Richard" <Anonymous@127. 001> wrote:
                [color=blue]
                ><font-color:#FF0000;>
                ><font size="4">
                ><font-size:4;>[/color]

                One out of those three is valid HTML. The other two are some sort of
                bizarre melding of HTML and CSS syntax.

                Now please explain how your three lines of rubbish pseudo-code is
                supposed to help the OP? O

                Steve

                --
                "My theories appal you, my heresies outrage you,
                I never answer letters and you don't like my tie." - The Doctor

                Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

                Comment

                • Jonathan N. Little

                  #9
                  Re: Why doesn't !important work here?

                  Richard wrote:
                  <snip>[color=blue]
                  > <font-color:#FF0000;>
                  > <font size="4">
                  > <font-size:4;>
                  >
                  >
                  >[/color]

                  Richard

                  FONT is an old HTML 3.2 tag, depreciated in 4.0 and the syntax was

                  <FONT FACE="SomeFontN ame" COLOR="RED" SIZE="4>...</FONT>

                  But don't do this! Time to buy a NEW book ... and read it.

                  --
                  Take care,

                  Jonathan
                  -------------------
                  LITTLE WORKS STUDIO

                  Comment

                  Working...