Multiple CSS Style Definitions

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

    Multiple CSS Style Definitions

    Hello,

    I would like to define some internal styles within an HTML page, but
    have those style overridden by an external style sheet if it exists at
    the location specified by a <link> element.

    If the external style sheet does not exist, then I would like the
    internal styles that are defined in the HEAD section of the HTML page
    to be used by default.

    I have not been able to find any information on how to setup this type
    of internal and external style definition.

    Does anyone know how this can be done?

    Regards,
    Jacob.
  • Andrew Thompson

    #2
    Re: Multiple CSS Style Definitions

    "Jacob" <jacob774@hotma il.com> wrote in message
    news:f95ff46c.0 312221541.6373d c3f@posting.goo gle.com...
    ....[color=blue]
    > I would like to define some internal styles within an HTML page, but
    > have those style overridden by an external style sheet if it exists at
    > the location specified by a <link> element.[/color]

    Have you tried defining the internal styles
    before the <link>?

    AFAIU the last styles defined take precedence.

    HTH

    --
    Andrew Thompson
    * http://www.PhySci.org/ PhySci software suite
    * http://www.1point1C.org/ 1.1C - Superluminal!
    * http://www.AThompson.info/andrew/ personal site


    Comment

    • Jacob

      #3
      Re: Multiple CSS Style Definitions

      "Andrew Thompson" <andrew64@bigNO SPAMpond.com> wrote in message news:<MkUFb.626 42$aT.58717@new s-server.bigpond. net.au>...[color=blue]
      > "Jacob" <jacob774@hotma il.com> wrote in message
      > news:f95ff46c.0 312221541.6373d c3f@posting.goo gle.com...
      > ...[color=green]
      > > I would like to define some internal styles within an HTML page, but
      > > have those style overridden by an external style sheet if it exists at
      > > the location specified by a <link> element.[/color]
      >
      > Have you tried defining the internal styles
      > before the <link>?
      >
      > AFAIU the last styles defined take precedence.
      >
      > HTH[/color]

      Hi Andrew,

      Yes, I tried putting the <link> both before and after the internal
      styles, but when I then viewed the HTML in IE 6.x it was displayed
      using the internal styles each time.

      (I know it was using the internal styles as I temporarily changed the
      color of the text in the internal style so I would know which set of
      styles were being applied.)

      Any other ideas?

      Regards,
      Jacob

      Comment

      • Jacob

        #4
        Re: Multiple CSS Style Definitions

        "Andrew Thompson" <andrew64@bigNO SPAMpond.com> wrote in message news:<MkUFb.626 42$aT.58717@new s-server.bigpond. net.au>...[color=blue]
        > "Jacob" <jacob774@hotma il.com> wrote in message
        > news:f95ff46c.0 312221541.6373d c3f@posting.goo gle.com...
        > ...[color=green]
        > > I would like to define some internal styles within an HTML page, but
        > > have those style overridden by an external style sheet if it exists at
        > > the location specified by a <link> element.[/color]
        >
        > Have you tried defining the internal styles
        > before the <link>?
        >
        > AFAIU the last styles defined take precedence.
        >
        > HTH[/color]

        Hi Andrew,

        As it turns out I did not have a color explicitly defined in the
        external styles, so the temporary color I did have defined in the
        internal styles were always taking effect.

        After I explicitly defined colors in the external styles, then the
        external styles would obviously apply to the HTML page if the <link>
        element was placed after the definition of the internal styles.

        Thank you for your help.

        Regards,
        Jacob.

        Comment

        • Andrew Thompson

          #5
          Re: Multiple CSS Style Definitions

          "Jacob" <jacob774@hotma il.com> wrote in message
          news:f95ff46c.0 312230713.997dc d3@posting.goog le.com...[color=blue]
          > "Andrew Thompson" <andrew64@bigNO SPAMpond.com> wrote in message[/color]
          news:<MkUFb.626 42$aT.58717@new s-server.bigpond. net.au>...[color=blue][color=green]
          > > "Jacob" <jacob774@hotma il.com> wrote in message
          > > news:f95ff46c.0 312221541.6373d c3f@posting.goo gle.com...
          > > ...[color=darkred]
          > > > I would like to define some internal styles within an HTML page, but
          > > > have those style overridden by an external style sheet if it exists at
          > > > the location specified by a <link> element.[/color]
          > >
          > > Have you tried defining the internal styles
          > > before the <link>?
          > >
          > > AFAIU the last styles defined take precedence.[/color][/color]
          ....[color=blue]
          > Yes, I tried putting the <link> both before and after the internal
          > styles, but when I then viewed the HTML in IE 6.x it was displayed
          > using the internal styles each time.
          >
          > (I know it was using the internal styles as I temporarily changed the
          > color of the text in the internal style so I would know which set of
          > styles were being applied.)
          >
          > Any other ideas?[/color]

          Sorry, no. I'll have to cede to those more
          experienced w/ overriding styles. I'm still a
          learner myself (with a great deal more to
          learn, by all indications).

          --
          Andrew Thompson
          * http://www.PhySci.org/ PhySci software suite
          * http://www.1point1C.org/ 1.1C - Superluminal!
          * http://www.AThompson.info/andrew/ personal site


          Comment

          • Andrew Thompson

            #6
            Re: Multiple CSS Style Definitions

            "Jacob" <jacob774@hotma il.com> wrote in message
            news:f95ff46c.0 312230756.31afd 971@posting.goo gle.com...[color=blue]
            > "Andrew Thompson" <andrew64@bigNO SPAMpond.com> wrote in message[/color]
            news:<MkUFb.626 42
            ....[color=blue]
            > As it turns out...[/color]

            :) I thought about it and realised my
            understanding of styles must be very
            remiss if I got the precedence wrong,
            so I thought to check it myself.

            [color=blue]
            > Thank you for your help.[/color]

            No worries. Glad you sorted it. ;-)

            --
            Andrew Thompson
            * http://www.PhySci.org/ PhySci software suite
            * http://www.1point1C.org/ 1.1C - Superluminal!
            * http://www.AThompson.info/andrew/ personal site


            Comment

            Working...