You are here: Re: Background in css gives warning « HTML « IT news, forums, messages
Re: Background in css gives warning

Posted by Jukka K. Korpela on 02/25/06 13:17

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.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

 

Navigation:

[Reply to this 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

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