Reply to Re: Background in css gives warning

Your name:

Reply:


Posted by Neredbojias on 02/25/06 23:57

With neither quill nor qualm, Jukka K. Korpela quothed:

> Neredbojias <invalid@neredbojias.com> wrote:
>
> > - - at least you should understand the css cascading of style
> > sheets which prompt the warning.
>
> People who understand the cascade won't ignore the warning. (Well, once
> in a blue moon they might - but they do it knowing what they are doing
> and not whining about the warning).
>
> >> Consider
> >> e.g cascading with a stylesheet which defined the background for
> >> span to be yellow.
> >
> > Since you surely mean a user stylesheet,
>
> I don't know what Alan had in his mind, but surely there might be a
> browser style sheet, too, or another author style sheet (say, after,
> ACME has bought all rights to your pages for an indecent sum of money
> and made them available in a context where ACME corporate style sheet
> is used, too).
>
> > suppose my body text color
> > was yellow? -With a brown body background?
>
> Your body text color and background are, as other properties,
> determined in the cascade.
>
> > If a hypothetical user
> > _overrides_ page settings, it is his responsibility to ensure that
> > he does not err in his endeavors.
>
> Yes, and the author has his part of the game to take care of.
>
> If both set color whenever setting background and vice versa, and do
> that well (with sufficient contrast), the serious problem of (say)
> yellow on yellow can be avoided. If _you_ set only color for <span>,
> then _you_ have a mistake, and it does not help that the user did his
> job well.
>
> > "Cascading" does _not_ mean
> > having to set a background-color for every color designated. In
> > fact, it means rather the opposite.
>
> The opposite? Don't be ridiculous.
>
> In the cascade, every property is handled separately for each element
> (after we have conceptually expanded all shortcuts). This might be a
> fundamental design flaw in CSS, but it's there. It implies that if you
> set the color property for an element without setting the background
> properties, the cascade may give the element any background.
>
> Even if you do things right, it is possible to break things, since a
> user style sheet could override your color setting and not set
> background. But _that_ would be a user's error, which is quite
> comparable to the author's mistake we are discussing.
>
> > Transparent??
>
> Transparent means that you accept that whatever the cascade happens to
> assign as value to the parent element's background property this time
> will appear as the background.
>
> > I do know the damn thing has errors, so whether a "validator" or a
> > "checker", it's flawed.
>
> It has its share of errors, but the warning you are complaining about
> is not among them.

Yep, you're right. I started replying in a much different manner than
this, but as I was describing a hypothetical scenario, I saw it.

Suppose I have white text/brown background on the body. I span a word,
coloring it yellow, sans background. The user comes along and styles
the body color brown and the body background yellow (including both
attributes correctly.) My spanned word "disappears" and I am at fault.

I really thought that _always_ setting both color and bg wasn't
necessary. What can I say? Would you accept a humble "oops"? Please
don't banish me to Finland 'cause I hate cold weather...

--
Neredbojias
Contrary to popular belief, it is believable.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация