Results 1 to 8 of 8

Thread: CSS and tranparency

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question CSS and tranparency

    I have a CSS for my menu, I wish the background color to be #dedede, but I also want it to be transparent, how do I make that?
    Code:
    .menu
    {
        BORDER-RIGHT: buttonhighlight thin outset;
        BORDER-TOP: buttonhighlight thin outset;
        VISIBILITY: hidden;
        BORDER-LEFT: buttonhighlight thin outset;
        WIDTH: 150px;
        LINE-HEIGHT: 140%;
        BORDER-BOTTOM: buttonhighlight thin outset;
        POSITION: absolute;
        BACKGROUND-COLOR: transparent;
        BACKGROUND: #dedede;
    }

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    How do you mean? Like semi-transparency? There is no CSS for that yet (not sure if it's in CSS 3), the only thing to do is use one of IEs proprietary filters, and use -moz-opacity to take care of Mozilla, but then your CSS won't validate. THe other alternative is to use a PNG which support alpha transparency. But IE for Win doesn't support it for some reason (see my sig. ).

    If that's not what you mean you'll have to be more specific.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    Hi Rick
    I've found out, I used the code below.
    Code:
    .menu
    {
        BORDER-RIGHT: buttonhighlight thin outset;
        BORDER-TOP: buttonhighlight thin outset;
        VISIBILITY: hidden;
        BORDER-LEFT: buttonhighlight thin outset;
        WIDTH: 150px;
        LINE-HEIGHT: 140%;
        BORDER-BOTTOM: buttonhighlight thin outset;
        POSITION: absolute;
        BACKGROUND-COLOR: silver;
        filter: alpha(opacity=85);
    }

  4. #4
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Yep, that's the MS proprietary stuff. You should also put -moz-opacity: 85% in there too so that it will work in Gecko based browsers.

  5. #5
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    yeah, Ricks right, filter: alpha(opacity=85); is an IE6 addition
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    Is the Mozilla opacity
    Code:
    filter: moz(opacity=85);

  7. #7
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    no, it's

    -moz-opacity: 85%
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  8. #8
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    ALso there is a list of all the CSS moz supports at http://lxr.mozilla.org/seamonkey/sou...sCSSPropList.h - proprietary and standard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width