Forum Moderators: not2easy

Message Too Old, No Replies

W3C CSS transparent background bug inverts.

Kind of happy day...

         

JAB Creations

7:08 pm on Jan 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The W3C has inverted the exceptionally obnoxious validator bug that would report a warning that your CSS did not include a background color if you set a color even if you intentionally set the background to 'transparent'.

However after doing a couple quick tests I also discovered that if you set the background-color and color to the same color you will not get a warning.

While I may have used a class at some point that had the same background-color and color I eventually found other methods to achieve the same goals. It's my view that a warning should still occur specifically for those who fail to set a background value (a color, transparent, or otherwise) or vice versa with color.

- John

swa66

10:17 am on Jan 7, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can specify the warning level you want yourself.

[jigsaw.w3.org...]
[jigsaw.w3.org...]

The warnings about colors and redefinitions IMHO are rather lame and fixing them leads to bloated code.

main problem with having them IMHO is that people learn to ignore the other warnings just as well.

Setek

12:49 am on Jan 8, 2007 (gmt 0)

10+ Year Member



There's a perfectly valid reason for warnings about background colours being either the same as the foreground colour or transparent.

Remember, they're warnings, not errors.

What's the point in the warning?
Well, if you set your background to transparent, you're saying "permit what's behind this background colour to affect the readability of this element and its foreground colour".

The reasoning behind setting a background to transparent is pretty much always the same: I have an image in an element behind this one, and I want that to show through.

This could potentially be bad, because of its accessibility issues, like what if someone has images turned off, and the resulting back- and fore-ground combination becomes illegible? Or what if the image, with its change in difference in brightness, and difference in colour (two specifications outlined by the W3C to determine safe legibility) makes it unreadable to a person say, with protanopia?

And what's the reasoning behind setting a background colour the same as a foreground colour?

I can't see any reason behind doing this, besides trying to up keyword hits, or making easter eggs.

So I don't believe the purpose of the text is to really be accessible in that case, regardless of its (if any) merit.

So why bother reading the warning at all?

I'd check if:

  • the image behind my transparently backgrounded object affects readability in any way;
  • without an image behind my transparently backgrounded object affects readability in any way;
  • I actually wanted someone to be able to read my identical back- and fore-ground colour combination; and
  • whether doing any of those things is really a good idea or not.

Now, while the validator doesn't flag warnings in all the right areas for all the right reasons, but the different W3C specifications tell you a whole bunch of reasons that apply to them.

[edited by: Setek at 12:51 am (utc) on Jan. 8, 2007]