Results 1 to 12 of 12
  1. #1
    Join Date
    Nov 2011
    Posts
    146

    Validate CSS opacity

    I use this CSS code to achieve an opacity of 25%:
    Code:
    background: rgba(127,127,127,0.25)
    Whilst this code works fine, it does not validate as CSS 2.1 due to the opacity part -> 0.25.

    I was wondering if someone knew a correct way of doing what my code does with CSS 2.1?

  2. #2
    Join Date
    May 2009
    Location
    United Kingdom
    Posts
    1,695
    I don't think there is a way to validate opacity with CSS (I could be wrong). Of course you could always use a transparent image to achieve this.
    Zomex ~ Templates & services for web hosting resellers since 2009!
    #1 Web Hosting Templates for WHMCS Templates | WordPress | HTML | Blesta | Clientexec
    █ Professional WHMCS Services | Installation | Configuration | Integration | Upgrades

  3. #3
    Join Date
    Nov 2011
    Posts
    146
    Yeah, transparent image my have to be the way to go to achieve validate code. Grrrrrrr

    See, I'm a strong advocate for using web standards, but when standards don't keep up with the times it makes it hard to justify why its important to use them. We have a long way to go in computers.
    Last edited by FinalFrontier; 12-19-2011 at 06:33 AM.

  4. #4
    Join Date
    May 2009
    Location
    United Kingdom
    Posts
    1,695
    Quote Originally Posted by FinalFrontier View Post
    Yeah, transparent image my have to be the way to go to achieve validate code. Grrrrrrr
    Yeah, it's definitely annoying although in most cases I prefer to save a lot of time then attempt to validate these type of things. Overall I think validation is a good thing but sometimes it makes more sense to use better methods that may show as errors.
    Zomex ~ Templates & services for web hosting resellers since 2009!
    #1 Web Hosting Templates for WHMCS Templates | WordPress | HTML | Blesta | Clientexec
    █ Professional WHMCS Services | Installation | Configuration | Integration | Upgrades

  5. #5
    Join Date
    Nov 2011
    Posts
    146
    Quote Originally Posted by zomex View Post
    Overall I think validation is a good thing but sometimes it makes more sense to use better methods that may show as errors.
    Indeed zomex. I've decided to stick with the method I am using. I have already made an exception for overflow-x, so I'm just going to make an exception for this opacity thing also. Transparent image is just ridiculas in 2011!
    I don't know why it takes W3C a decade to make a web standard. You can make an operating system in that time.

  6. #6
    Join Date
    Oct 2009
    Posts
    176
    Why are you validating against CSS2.1?
    If you're going to be using CSS3 features, just select CSS3 in the options for the validator, it'll work just fine.

  7. #7
    hi

    have you try his ?

    filter:alpha(opacity=40);
    opacity: 0.4;
    works on all Browsers

  8. #8
    Join Date
    Nov 2010
    Posts
    620
    Quote Originally Posted by FinalFrontier View Post
    Indeed zomex. I've decided to stick with the method I am using. I have already made an exception for overflow-x, so I'm just going to make an exception for this opacity thing also. Transparent image is just ridiculas in 2011!
    I don't know why it takes W3C a decade to make a web standard. You can make an operating system in that time.
    What has been stated for opacity, also counts for overflow-x: validate against CSS3. W3C has indeed kept up with the times, your rant makes no sense.

    What's this doing in Programming by the way?

  9. #9
    Join Date
    Nov 2011
    Posts
    146
    Jack, no I haven't tried that and I will try it later on tonight. Thanks for that.


    InsDel. CSS 3 isn't a standard yet, CSS 2.1 is the latest standard, hence why I am using it.

    8088, your a major noob. Who builds a website on something that isn't a standard? Take your ignorant whining else where.
    Last edited by FinalFrontier; 12-19-2011 at 09:10 PM.

  10. #10
    Join Date
    Nov 2010
    Posts
    620
    Quote Originally Posted by FinalFrontier View Post
    Who builds on something that isn't a standard?
    Mozilla, Microsoft, Google and Apple, to name a few. Oh, and you apparently.

    You're welcome.

  11. #11
    Join Date
    Jul 2007
    Location
    Virginia
    Posts
    1,314
    Who cares about validity as long as it works? It's not like the validity police will hunt you down if you have one line of CSS which doesn't make it though...
    ~ @PreetamJinka

  12. #12
    Join Date
    Oct 2009
    Posts
    176
    Quote Originally Posted by FinalFrontier View Post
    InsDel. CSS 3 isn't a standard yet, CSS 2.1 is the latest standard, hence why I am using it.
    Not wholly true. CSS 2.1 and CSS3 Color (including RGBA, HSLA, etc.) are both W3C Recommendations since 7 June.

Similar Threads

  1. Twitter widget CSS fails to validate
    By SERVERIA in forum Programming Discussion
    Replies: 1
    Last Post: 02-07-2010, 02:36 AM
  2. Helo with opacity in CSS
    By bambinou in forum Web Design and Content
    Replies: 8
    Last Post: 10-19-2009, 12:45 PM
  3. Table Cell Opacity / Transparent ??????????
    By lost2 in forum Web Design and Content
    Replies: 18
    Last Post: 12-13-2005, 04:47 PM
  4. Help Validate CSS
    By Blackg in forum Web Design and Content
    Replies: 19
    Last Post: 05-17-2005, 06:22 PM
  5. Validate my CSS/Html for $$?
    By Volconvo in forum Other Offers & Requests
    Replies: 8
    Last Post: 03-26-2004, 05:58 AM

Posting Permissions

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