Re: Possibly invalid warnings, and misc. nitpickings

Jeremy wrote on Monday, January 6, 2003 at 12:00:54 AM:

> By reading http://www.w3.org/TR/REC-CSS1#border it seems to allude
> that an omitted color still explicitly sets the border color to the
> color of the element itself.

Yep.

> I changed the CSS to just set border-width and border-style, and
> that got rid of the warning.

That would do it.

> It seems having border explicitly set an omitted color to the same
> value it would be anyhow (as with setting just -width and -style)
> causes rather meaningless errors. Just wanted to make sure that
> warning is being thrown for good cause.

It's not a meaningless error. It's actually more helpful than warning
about two color properties on the same element, since many people
don't know that the border property sets border-color even if you
leave out an explicit border-color value.

The validator warns you if you redefine something in case you didn't
realize you redefined it. There's nothing wrong with redefinition per
se.

In this case, the border is first defined to be white, and later
redefined to be black. That means it will be black, which probably is
expected. If the order of the CSS was different, however, the border
may be white, which probably is not expected (but certainly valid
CSS).

> (I wanted to eliminate the warning so users clicking the "Valid CSS"
> link on my pages see both no errors, and no warnings, and hopefully
> will be envious and fix their own pages. Yeah, right. I can dream.)

Essentially, warnings are for authors only. If you know why the
warnings are there, there's no reason to complicate your CSS to get
around the warning. The CSS validator can validate without warnings,
if you'd like (it's one of the options).

For example, the W3C home page without warnings (this should be all on
one line):
http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.w3.org%2F&warning=no&profile=css2

-- 
John

Received on Tuesday, 21 January 2003 11:26:05 UTC