|
Posted by Vlatko Juric-Kokic on 06/08/06 16:22
On Thu, 08 Jun 2006 07:13:51 -0400, Neredbojias
<http://www.neredbojias.com/fliam.php?cat=alt.html> wrote:
>To further the education of mankind, Vlatko Juric-Kokic <vlatko@pcchip.hr>
>vouchsafed:
>
>> I'm fiddling with some pages and went to see whether the CSS will
>> validate.
>>
>> Unfortunately, not.
>>
>> The validator gives warning "you have no background-color with your
>> color" for several elements. But I specifically put in
>> "background-color: transparent", which is allowed/required according
>> to CSS 2.1:
>>
>> "background-color
>> This property sets the background color of an element, either a
>> <color> value or the keyword 'transparent', to make the underlying
>> colors shine through."
>>
>> So why the warning?
>
>Ah ha, I just got done digging into that somewhat and have discovered some
>interesting tidbits. First of all, the new validator does not consider
>"transparent" a color. Many of my previously unwarninged pages were now
>being warned. This pissed me off.
Me too. :-)
Furthermore, background-color: transparent is among the valid pieces
of CSS listed for my style sheet. How about that for inconsistency?
OTOH, it's true that CSS 3 lists only <color> as the value for
"background-color". If I haven't missed something, it's not exactly
the best idea.
Still, I specifically told the validator to use 2.1...
>However, in trying to fix things up, I
>discovered that "inherit" can be used, although maybe not always in the
>same way, to accomplish the desired goal.
Unfortunately, not in this case. It's a CSS layout with the background
colour and images in the body, while the warned parts are text DIVs
with transparent background, going over the images. Should I use
"inherit" for background-color, all the DIVs would ultimately use the
background-color from body and obscure parts of the background
image(s).
>I didn't previously realize (or
>such was not the case previously) that "inherit" will allow you to "carry
>forward" a random background _in phase_ with the original regardless of
>where the secondary container lies. This solves a lot of problems.
I'm not certain I follow you here. What do you mean with "in phase"?
"Inherit" carries over a value from the parent element. Multiple
levels of "inherit" would only carry over the value from the original
parent element, right?
>In short, after about 2 hours, I had all of my 20 or so affected pages back
>to warningless status. It _can_ be done, but you might have to change the
>html a little, etc.
Ah, well. I'm _really_ loath to fiddle with the design and stuff
again, cause I'm pretty much happy with it. The "background-color:
transparent" works in six browsers (Opera, Firefox, Mozilla, Explorer,
Safari, Explorer Mac). Given that it will be a while till they really
support CSS 3, I think I'm safe for the moment. And when they change,
it will be a high time to change the design, anyway. :-)
Thanks.
vlatko
Navigation:
[Reply to this message]
|