Transparent Background-Colour

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

    Transparent Background-Colour

    Hi,

    my problem: I have some tables with transparent backgrounds, which are
    changed in colours within a JavaScript DOM function to have a roll-over
    effect.

    Now, i can't get them back transparent when leaving the mouse out of the
    rollover-box - background-color: none; seems not to work.

    Isn't it possible to do this with CSS?


    Greetings, Thomas

  • Andrew Thompson

    #2
    Re: Transparent Background-Colour

    "Thomas Wieser" <wernze.nospan@ gmx.net> wrote in message
    news:bh7b1i$uon td$1@ID-202437.news.uni-berlin.de...
    .....[color=blue]
    > my problem: I have some tables with transparent backgrounds, which are
    > changed in colours within a JavaScript DOM function to have a roll-over
    > effect.
    >
    > Now, i can't get them back transparent when leaving the mouse out of the
    > rollover-box - background-color: none; seems not to work.[/color]

    Have you considered using background-image instead?

    You could use a 1x1 pixel colored gif or png
    for your colors, and a similar transparent one
    for 'see-through'.

    [ I don't know if there is a way of doing it with
    background-color ]

    HTH

    --
    Andrew Thompson






    Comment

    • Fox

      #3
      Re: Transparent Background-Colour



      Thomas Wieser wrote:[color=blue]
      >
      > Hi,
      >
      > my problem: I have some tables with transparent backgrounds, which are
      > changed in colours within a JavaScript DOM function to have a roll-over
      > effect.
      >
      > Now, i can't get them back transparent when leaving the mouse out of the
      > rollover-box - background-color: none; seems not to work.
      >
      > Isn't it possible to do this with CSS?[/color]

      If you do this with javascript (onmouseover/onmouseout attributes in
      table tags), just set the backgroundColor to an empty string:

      <table onmouseover = "this.style.bac kgroundColor='r ed'"
      onmouseout = "this.style.bac kgroundColor = ''">[color=blue]
      >
      > Greetings, Thomas[/color]

      Comment

      • Chris Morris

        #4
        Re: Transparent Background-Colour

        Thomas Wieser <wernze.nospan@ gmx.net> writes:[color=blue]
        > my problem: I have some tables with transparent backgrounds, which are
        > changed in colours within a JavaScript DOM function to have a
        > roll-over effect.
        >
        > Now, i can't get them back transparent when leaving the mouse out of
        > the rollover-box - background-color: none; seems not to work.[/color]

        Try background-color: transparent; - there isn't a background-color: none;
        [color=blue]
        > Isn't it possible to do this with CSS?[/color]

        table { background-color: transparent; }
        table:hover { background-color: red; }

        Browser support will vary - certainly older browsers only tended to
        support :hover on <a>.

        --
        Chris

        Comment

        • Johannes Koch

          #5
          Re: Transparent Background-Colour

          Thomas Wieser wrote:[color=blue]
          > Hi,
          >
          > my problem: I have some tables with transparent backgrounds, which are
          > changed in colours within a JavaScript DOM function to have a roll-over
          > effect.
          >
          > Now, i can't get them back transparent when leaving the mouse out of the
          > rollover-box - background-color: none; seems not to work.[/color]

          'none' is not a valid value for background-color. Why not try
          'transparent' if you want the background to be transparent?
          --
          Johannes Koch
          In te domine speravi; non confundar in aeternum.
          (Te Deum, 4th cent.)

          Comment

          • Tim

            #6
            Re: Transparent Background-Colour

            "Thomas Wieser" <wernze.nospan@ gmx.net> wrote
            [color=blue][color=green]
            >> my problem: I have some tables with transparent backgrounds, which are
            >> changed in colours within a JavaScript DOM function to have a roll-over
            >> effect.
            >>
            >> Now, i can't get them back transparent when leaving the mouse out of the
            >> rollover-box - background-color: none; seems not to work.[/color][/color]


            On Mon, 11 Aug 2003 06:51:28 GMT,
            "Andrew Thompson" <andrew64@bigNO SPAMpond.com> wrote:
            [color=blue]
            > Have you considered using background-image instead?
            >
            > You could use a 1x1 pixel colored gif or png
            > for your colors, and a similar transparent one
            > for 'see-through'.
            >
            > [ I don't know if there is a way of doing it with
            > background-color ][/color]

            Is it any wonder that we have so many bad websites, when instead of
            checking if something can be done (like reading the publicly available
            CSS specifications) , a convoluted and daft solution is done, instead?

            CSS was designed to get away from doing daft tricks with images, to
            achieve the desired results, directly. But we still have people using
            CSS to do the same stupid trick in yet another way.

            There's things like "background-image: none" which could ensure that no
            preset background image is used, anymore. And "background-color:
            transparent" to get transparent (sic) colours.

            Anybody authoring for the web should really read the HTML and CSS
            specifications. Even if they only read the preambles, and the technical
            bits directly related to what they're trying to do, rather than the
            whole lot. Anybody who says that they can't understand the specs,
            probably doesn't have the nouse to understand what they're doing when
            they're authoring, either.

            Why play with technical things, if you don't have a technical bent.
            Please don't get interested in first aid, we don't need people
            practising things without proper knowledge.

            --

            I'm sick of seeing too many stupid things over the last few days...

            --
            My "from" address is totally fake. The reply-to address is real, but
            may be only temporary. Reply to usenet postings in the same place as
            you read the message you're replying to.

            Comment

            • Andrew Thompson

              #7
              Re: Transparent Background-Colour


              "Tim" <admin@sheerhel l.lan> wrote in message
              news:hlefjv0mhn f9s1ll8325060r4 fj902nns6@4ax.c om...
              ....[color=blue]
              > Anybody authoring for the web should really read the HTML and CSS
              > specifications.[/color]

              And anybody getting snotty about the quality of _my_
              answers could at least provide a link to the resource
              they were mentioning.

              http://www.w3.org/TR/CSS2/ (unless you have a better one)

              --
              Andrew Thompson






              Comment

              • Tim

                #8
                Re: Transparent Background-Colour

                "Tim" <admin@sheerhel l.lan> wrote
                [color=blue][color=green]
                >> Anybody authoring for the web should really read the HTML and CSS
                >> specifications.[/color][/color]

                On Mon, 11 Aug 2003 23:21:36 GMT,
                "Andrew Thompson" <andrew64@bigNO SPAMpond.com> wrote:
                [color=blue]
                > And anybody getting snotty about the quality of _my_
                > answers could at least provide a link to the resource
                > they were mentioning.
                >
                > http://www.w3.org/TR/CSS2/ (unless you have a better one)[/color]

                See, you found it; and you get to read them for free, too. I can't
                believe that those links aren't posted in this news group so repeatedly
                that you'd never have encountered, and bookmarked, them before.

                Any newcomer not bothering to look for what's a FAQ, doesn't gain a
                great deal of sympathy, either.

                --
                My "from" address is totally fake. The reply-to address is real, but
                may be only temporary. Reply to usenet postings in the same place as
                you read the message you're replying to.

                Comment

                Working...