DIV transpancy

Discussion in 'CSS' started by redhits, Nov 11, 2009.

  1. #1
    I know there is an CSS option : background:transparent

    but, how i can make a background be white color, and only be transparent 20%?
    like that fill thing in photoshop if you get me...
     
    redhits, Nov 11, 2009 IP
  2. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #2
    opacity:0.2
    Actually, probably, 0.8 is what you want.
     
    drhowarddrfine, Nov 11, 2009 IP
  3. silverf0x

    silverf0x Well-Known Member

    Messages:
    535
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #3
    transparent (CSS) have 2 different format for Firefox browser and IE.
    For details maybe you can see this CSS :
     
    silverf0x, Nov 11, 2009 IP
  4. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #4
    That has not been true for quite some time. opacity works fine in Firefox, Opera, Safari but, of course, not in IE8.
     
    drhowarddrfine, Nov 11, 2009 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    He's asking for just the background, by default Opacity effects the entire element and it's children. If you just want the background transparent you are either stuck using an alpha transparency .png (fat, bloated, another file handshake) or the technique I just wrote about a day or two ago.

    http://forums.digitalpoint.com/showthread.php?t=1561723#post12868403

    Which is bloated markup, but at least means you don't have to resort to alpha .png.
     
    deathshadow, Nov 15, 2009 IP
  6. ryt

    ryt Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    There is always

     #div { background: rgba(217,217,217,0.7; } 
    Code (markup):
    Giving you a grey opacity with 70% opacity (Not compatible in IE or earlier versions of FF )

    Just another alternative depending on your audience!
     
    ryt, Nov 16, 2009 IP