This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > October 2005 > Validation problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Validation problem
Ed Mullen

2005-10-12, 6:27 pm

The http://jigsaw.w3.org/ validator does not seem to like "transparent"
as a background color and gives this error:

Line : 5 (Level : 1) You have no background-color with your color : #logo_1

on this CSS:

#logo_1 {
font-family: Arial, Helvetica, Geneva, Sans-Serif;
font-size: 150%;
font-weight: normal;
color: #660000;
background-color: transparent;
}

..cite1 {
font-family: Arial, Helvetica, Geneva, Sans-Serif;
color: #660000;
background-color: #338833;
}

All of my style sheets validated the last time I checked them but all of
a sudden they are failing with this error.

Any info gratefully accepted.

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
Is there another word for synonym?
Ed Mullen

2005-10-12, 6:27 pm

Ed Mullen wrote:
> The http://jigsaw.w3.org/ validator does not seem to like "transparent"
> as a background color and gives this error:
>

[snip]

Ok, here's a further test.

Using the info from these w3 sites:

http://www.w3schools.com/css/css_background.asp
http://www.w3schools.com/css/tryit....ackground-color

The code from the second link is:

body {background-color: yellow}
h1 {background-color: #00ff00}
h2 {background-color: transparent}
p {background-color: rgb(250,0,255)}

I put this online at: http://ed.mullen.home.comcast.net/temp/junk.css

Then I checked the code at http://jigsaw.w3.org/css-validator/ using
each of the three ways offered: an online URL, a file upload, and
pasting the text into the box. The last two produce a response that
would lead a user to believe the css code does not validate. However,
the first method pronounces "Congratulations" and that "This document
validates as CSS!" But it also gives the warnings about having no
background-color specified.

Very confusing.

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
In any conflict the boundaries of behavior are defined by the party
which cares least about morality. - Randy Wayne White
Alan J. Flavell

2005-10-12, 6:27 pm

On Wed, 12 Oct 2005, Ed Mullen wrote:

> The http://jigsaw.w3.org/ validator does not seem to like
> "transparent" as a background color and gives this error:


It's not an error. It's a warning.

> Line : 5 (Level : 1) You have no background-color with your color : #logo_1


Quite right. Review previous discussion on this issue.

> All of my style sheets validated the last time I checked them but all of a
> sudden they are failing with this error.


It's *not* an error. Look again at the report: If there are any
errors, they will be *listed* as errors.

| Congratulations!
|
| Valid CSS! This document validates as CSS!

Wasn't that clear?

Then there is a sub-header for the warnings:

| Warnings
| URI : http://ed.mullen.home.comcast.net/styles/default.css

if there are any (and in this case there were quite a few).

It's a piece of advice, and it relates to the cascade (that's the "C"
in "CSS"). But see the previous discussion for detail.
Ed Mullen

2005-10-12, 6:27 pm

Alan J. Flavell wrote:

> On Wed, 12 Oct 2005, Ed Mullen wrote:
>
>
>
>
> It's not an error. It's a warning.
>


I finally realized that. See my first response to myself in this thread.
>
>
>
> Quite right. Review previous discussion on this issue.
>
>
>
>
> It's *not* an error. Look again at the report: If there are any
> errors, they will be *listed* as errors.
>
> | Congratulations!
> |
> | Valid CSS! This document validates as CSS!
>
> Wasn't that clear?


Sure, once I finally saw it after validating the code as an online file.
As I said in my other post there are three methods of validation and
that message only is given by one of them.

>
> Then there is a sub-header for the warnings:
>
> | Warnings
> | URI : http://ed.mullen.home.comcast.net/styles/default.css
>
> if there are any (and in this case there were quite a few).


Why are you talking about that style sheet? I never mentioned it in
either of my posts.

>
> It's a piece of advice, and it relates to the cascade (that's the "C"
> in "CSS"). But see the previous discussion for detail.


I read the previous discussion and I understand the concept of cascades.
I appreciate your comments but none of them address my original point
which is that the validator doesn't recognize /transparent/ as a value.
That's the primary source of the warnings.


--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
An ounce of practice is worth more than tons of preaching. - Mohandas Gandhi
Arne

2005-10-12, 6:27 pm

Once upon a time *Ed Mullen* wrote:
> Alan J. Flavell wrote:
>
> I read the previous discussion and I understand the concept of cascades.
> I appreciate your comments but none of them address my original point
> which is that the validator doesn't recognize /transparent/ as a value.
> That's the primary source of the warnings.


The validator gives the warnings because if you don't have a
background color the written content may not be visible to a user with
a custom stylesheet with a prefered background color for the body.
That may give the same color for background and for text content. And
a transparent color is the same as no color in that sentence, since
the "main" background is visible.

But after all, it's not an error to omit the background color. And
even the word "Warning" sounds a bit hard, better to call it an
"Advice" since that's what it is really (in my humble opinion) :)

So, if the "main" background color (or image) is essential to keep
"clean" and not interupted with other colors, then use the transparent
with the knowledge that some users may not see that part of the content.

--
/Arne
Now killing all posts originating at GoogleGroups
Workaround: http://www.safalra.com/special/googlegroupsreply/
-------------------------------------------------------------
Alan J. Flavell

2005-10-12, 6:27 pm

On Wed, 12 Oct 2005, Ed Mullen wrote:

>
> Why are you talking about that style sheet?


I tried validating the obvious web page URL that you had cited in your
posting.

> I never mentioned it in either of my posts.


Presumably it's referenced from the URL that you cited, though.

> I read the previous discussion and I understand the concept of
> cascades. I appreciate your comments but none of them address my
> original point which is that the validator doesn't recognize
> /transparent/ as a value.


It does rather look that way - well, at least it doesn't treat
"transparent" as specifying an explicit colour, and it reports
accordingly.

However, the resulting advice is still good - even if one believes it
was offered for the wrong reason. Specifying an explicit text colour,
together with "transparent" as the background colour, could just as
likely fall foul of a hostile cascade, as specifying an explicit text
colour and omitting any background colour. Think it through, and
you'd have to come to the same conclusion, I reckon.

There may be some motive why you want to accept this risk, but the
warning is still an appropriate one, IMHO.
Alan J. Flavell

2005-10-12, 6:27 pm

On Wed, 12 Oct 2005, Alan J. Flavell wrote:

> I tried validating the obvious web page URL that you had cited in your
> posting.
>
>
> Presumably it's referenced from the URL that you cited, though.


To be clear - I seem to have confused yout test URL with the one in
your sig, and validated the latter instead. But it doesn't change the
conclusion.

regards
Ed Mullen

2005-10-12, 6:28 pm

Arne wrote:

> Once upon a time *Ed Mullen* wrote:
>
>
>
> The validator gives the warnings because if you don't have a
> background color the written content may not be visible to a user with
> a custom stylesheet with a prefered background color for the body.
> That may give the same color for background and for text content. And
> a transparent color is the same as no color in that sentence, since
> the "main" background is visible.
>
> But after all, it's not an error to omit the background color. And
> even the word "Warning" sounds a bit hard, better to call it an
> "Advice" since that's what it is really (in my humble opinion) :)
>
> So, if the "main" background color (or image) is essential to keep
> "clean" and not interupted with other colors, then use the transparent
> with the knowledge that some users may not see that part of the content.
>


Thanks, Arne. All of the pages on my site use a background image so it
seems that transparent would be the best choice for those definitions
where I had not specified a background color.

I still find it quite strange that transparent is a legal value for that
property and the validator tells me I have not specified one. Sigh.

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
Music is essentially useless, as life is. - George Santayana
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews