by skyvia
1 replies
  • WEB DESIGN
  • |
Hi all,


I've been trying out the CSS opacity function. I was just wondering if there are any major pitfalls to using it I hadn't considered?

Also, I have a problem with it. When I set a div opacity, and divs nested withing it inherit the same opacity, and I can't seem to over-ride that. Is it just not possible, or is there a way round this?

If there isn't a way round this, maybe they should consider it before it's released as standard code?
#css #opacity
  • Profile picture of the author erbuc
    I would suggest using the RGBA method available with CSS 3.

    HTML Code:
    background-color: rgba(256, 0, 0, .6);
    color: rgba(256, 0, 0, .6);
    This gives you a red background or color with 60% opacity on your div or element it is assigned to.

    It works in FireFox, Chrome, Safari and Opera. So the only draw back is it's lack of support in Internet Explorer.

    With IE, you would need to create a small background image and set the transparency of the layer to your desired opacity. Then save the file as a PNG file. Then use the background-image attribute in your CSS for that div.
    {{ DiscussionBoard.errors[4128546].message }}

Trending Topics