Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: CSS and opacity

  1. #1
    Banned
    Join Date
    Jan 2012
    Posts
    26
    Thanks
    4
    Thanked 0 Times in 0 Posts

    CSS and opacity

    I am using this for my background:

    background: rgba(127,127,127,0.25)

    This isn't valid CSS and I am wanting to use:

    background: rgb(127,127,127);
    opacity: 0.25


    The problem with using the second one is that the opacity also effecting everything inside the DIV container.

    Does anyone have a solution for just getting the background at 25% opacity, whilst being CSS compliant (no transparent image as background please :P)?

  • #2
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,274
    Thanks
    28
    Thanked 271 Times in 265 Posts
    Quote Originally Posted by FlashDancer View Post
    Does anyone have a solution for just getting the background at 25% opacity, whilst being CSS compliant (no transparent image as background please :P)?
    Change the validation profile (under "More Options") to CSS3 if using the W3C's validator. The default profile is CSS2.1.

    Your RGBA code is valid CSS and defined in CSS3 Color.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

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