CSS Opacity

Discussion in 'Web Design and Development' started by dcv, Apr 20, 2007.

  1. dcv macrumors G3

    May 24, 2005
    I have three div elements on a web page; all the same background-image. The first is set to 100% opacity, the second at 66%, the third at 33%.

    This is the CSS I'm using:

    .fullfade {
    	opacity: 0.33;
    	filter: alpha(opacity=33);	/* for IE */
    I've tested my site in Safari, Firefox(Mac+Win), Opera(Mac+Win), Camino, Shiira, OmniWeb and IE6(Win) (had to put the second line in to get it working in IE :rolleyes: )

    I ran my CSS through a validator last night and it reported that 'opacity' wasn't valid CSS :confused: But it's in the W3C CSS3 recommendation.

    It seems to work so perhaps I shouldn't worry too much but I'm curious as to why it says this isn't valid. Am I doing something wrong?
  2. justG macrumors member


    Apr 9, 2007
    Orlando, FL, US
    I think you answered your own question. It may be valid CSS3, but since CSS3 isn't "in production" yet, I think that the validator checks against the CSS2 spec.
  3. dcv thread starter macrumors G3

    May 24, 2005
    Ahhh ok thanks, just wanted to check in case I was doing something stupid!
  4. LastLine macrumors 65816

    Aug 24, 2005
    Any chance you can link me to the site? I'm intrigued to see the effect this has :)
  5. tominated macrumors 68000


    Jul 7, 2006
    Queensland, Australia
    you can validate using css3. just make sure css3 is chosen in the advanced options
  6. dcv thread starter macrumors G3

    May 24, 2005
    Sorry it's only on my local machine at the moment!

    The effect is basically this though - just 'faded'-looking images.

    My first ever website and it looks bloody awful :eek: I have zero creativity :eek:

    I'm not a web developer (^obviously!) but am an application developer. Decided to build this site from scratch (pure XHTML/CSS/Javascript) rather than using any of those wysiwyg "web" programs. It doesn't have to be done to any particular standards but I've tried to stick to XHTML 1.0 Strict - and *yay* it validates. Then tried to validate the CSS - everything's fine apart from that 'opacity' thing, which bothers me a little.
  7. dcv thread starter macrumors G3

    May 24, 2005
    D'oh! Probably an option I failed to see last night then :eek: (I was very tired!)

    Thanks, I'll give it another go later then...

Share This Page