473,508 Members | 2,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validatingresult strange

The stylesheet submitted for checking by W3C gives 2 warnings. no color
for background. But the backgroudcolor is
given. What can be wrong? This is the stylesheet:
http://lehmann.fateback.com/lehmann.css

--
http://lotto924.fateback.com
Feb 15 '06 #1
8 1148
Peter wrote:
The stylesheet submitted for checking by W3C gives 2 warnings. no color
for background. But the backgroudcolor is
given. What can be wrong? This is the stylesheet:
http://lehmann.fateback.com/lehmann.css


You need to set *color* for those places that only set *background*.

body { color: black; }

#footer { color: transparent; }

--
-bts
-Warning: I brake for lawn deer
Feb 15 '06 #2
Peter wrote:
The stylesheet submitted for checking by W3C gives 2 warnings. no color
for background. But the backgroudcolor is
given. What can be wrong? This is the stylesheet:
http://lehmann.fateback.com/lehmann.css


The actual warnings are:

Line : 4 (Level : 1) You have no color with your background-color :
body
Line : 67 (Level : 1) You have no color with your background-color :
#footer

and the styles in question are:

body {
font-family: "Times New Roman", Times, serif;
width: 80%;
background: #FFC;
}

#footer {
background: #FFC;
border-top: 0.2em solid #CCE5FF;
clear: both;
width: 100%;
margin: 4% auto;
padding: 5%;
text-align: center;
font-size: 80%;
}

In both case you have set a background colour but not set a foreground
colour, hence the warning.

Steve

Feb 15 '06 #3
Peter wrote:
The stylesheet submitted for checking by W3C gives 2 warnings. no color
for background. But the backgroudcolor is
given. What can be wrong? This is the stylesheet:
http://lehmann.fateback.com/lehmann.css


It doesn't say "no color for background". It says "You have no color
with your background-color : body" and "You have no color with your
background-color : #footer". These are accurate statements. You defined
background-color for both of these, and color for neither.
Feb 15 '06 #4
Harlan Messinger wrote:
Peter wrote:
The stylesheet submitted for checking by W3C gives 2 warnings. no
color for background. But the backgroudcolor is
given. What can be wrong? This is the stylesheet:
http://lehmann.fateback.com/lehmann.css

It doesn't say "no color for background". It says "You have no color
with your background-color : body" and "You have no color with your
background-color : #footer". These are accurate statements. You
defined background-color for both of these, and color for neither.


Thank you all for the quick response. It validates now!
Peter

--
http://lotto924.fateback.com
Feb 15 '06 #5
On Wed, 15 Feb 2006, Beauregard T. Shagnasty wrote:
Peter wrote:
The stylesheet submitted for checking by W3C gives 2 warnings. no color
for background. But the backgroudcolor is
given. What can be wrong? This is the stylesheet:
http://lehmann.fateback.com/lehmann.css

FAQ, see http://www.websitedev.de/css/validator-faq#color
You need to set *color* for those places that only set *background*.
It's advisable and recommended, indeed - for more-reliable cascading
with other stylesheets, particularly a user stylesheet or default
browser settings. And it's more resilient against some browser bugs.
body { color: black; }
I think you're saying to *add* that property setting to the existing
body { } specification, yes? Not to create two separate body { }
specifications...
#footer { color: transparent; }


That's not such a good idea. "transparent" runs much the same risk of
cascading badly with other stylesheets, as not specifying it at all
(in detail its cascading properties would be different, but it's
nevertheless the same principle).

It's best if you either specify *both* colours explicitly, or
*neither*, *at each specificity*. It isn't always feasible to do that
in every situation - especially when you have a background image on an
outer element which you want to shine through some inner element(s) -
but it's a good principle to keep to, as far as possible. This is a
*warning*, after all, rather than an actual error.

(See also the discussion under
http://www.w3.org/Bugs/Public/show_bug.cgi?id=2421 )

Feb 15 '06 #6
Peter wrote:
Harlan Messinger wrote:

It doesn't say "no color for background". It says "You have no color
with your background-color : body" and "You have no color with your
background-color : #footer". These are accurate statements. You
defined background-color for both of these, and color for neither.

Thank you all for the quick response. It validates now!


You're welcome. I just wanted to point out that it validated before.
Those were warnings, not validation errors.
Feb 15 '06 #7
Alan J. Flavell wrote:
On Wed, 15 Feb 2006, Beauregard T. Shagnasty wrote:
Peter wrote:
The stylesheet submitted for checking by W3C gives 2 warnings. no color
for background. But the backgroudcolor is
given. What can be wrong? This is the stylesheet:
http://lehmann.fateback.com/lehmann.css
FAQ, see http://www.websitedev.de/css/validator-faq#color
Yes, I've seen it, but perhaps the OP hasn't.
You need to set *color* for those places that only set *background*.


It's advisable and recommended, indeed - for more-reliable cascading
with other stylesheets, particularly a user stylesheet or default
browser settings. And it's more resilient against some browser bugs.
body { color: black; }


I think you're saying to *add* that property setting to the existing
body { } specification, yes? Not to create two separate body { }
specifications...


Correctamundo.
#footer { color: transparent; }


That's not such a good idea. "transparent" runs much the same risk
of cascading badly with other stylesheets, as not specifying it at
all (in detail its cascading properties would be different, but it's
nevertheless the same principle).


Would depend on how many style sheets are used, of course. Should not be
a problem with just one.
It's best if you either specify *both* colours explicitly, or
*neither*, *at each specificity*. It isn't always feasible to do
that in every situation - especially when you have a background image
on an outer element which you want to shine through some inner
element(s) - but it's a good principle to keep to, as far as
possible. This is a *warning*, after all, rather than an actual
error.


Good advice.

--
-bts
-Warning: I brake for lawn deer
Feb 15 '06 #8
On Wed, 15 Feb 2006, Beauregard T. Shagnasty wrote:
Alan J. Flavell wrote:
That's not such a good idea. "transparent" runs much the same risk
of cascading badly with other stylesheets, as not specifying it at
all (in detail its cascading properties would be different, but it's
nevertheless the same principle).


Would depend on how many style sheets are used, of course.


But in the final analysis, the author has no control over whether the
user is applying a user stylesheet or not. That is, after all, one of
the features of *Cascading* style sheets.

Some users might be applying a user stylesheet for accessibility
reasons (e.g due to eyesight problems they prefer to read light
coloured text on a dark ground), so this is a WAI issue too - see the
last sentence of section 9.1
http://www.w3.org/TR/WCAG10-CSS-TECH...color-contrast , although
the sentence omits to explain the background to the advice.

If both participants follow the rule when formulating their respective
stylesheets ("specify either both colours or neither, at each
specificity") then they get the best collective chance of a readable
result, in the face not only of regular CSS cascading, but even in the
face of browser inheritance bugs. The end result of the cascade might
look a bit odd, but at least each text will be presented against a
chosen background colour (assuming that any browser inheritance bugs
would almost certainly affect foreground and background colours
equally).

And this can be done without compromising the appearance for users who
accept the author's stylesheet in its entirety, which is how things
are supposed to work (IMHO, anyway).

If either of them fails to follow the rule, the result *could* be some
black text on a black background (etc.), with the reader being unaware
that they are missing anything. Even if it only ends up with poor
contrast, it's irksome.

[As I said, this agenda isn't always feasible (primarily when
background images are involved), but I'd recommend following the
principle when possible. And not just because it causes the CSS
checker to stop bleating...]

cheers
Feb 15 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1795
by: Arthur | last post by:
I've come across some strange xml, that I need to deal with, it looks like this:- <root> <foo attr="1">Some random strange text. <bar attr="2">blar</bar> <bar attr="3">blar blar</bar> <bar...
2
1949
by: Paul Drummond | last post by:
Hi all, I am developing software for Linux Redhat9 and I have noticed some very strange behaviour when throwing exceptions within a shared library. All our exceptions are derived from...
2
8909
by: Olaf | last post by:
I have a frameset page witch contains the myFuc() function. The function is accessed from a page in one of the frames in the frameset. An example is shown below. <input...
7
1652
by: M O J O | last post by:
Hi, I'm developing a asp.net application and ran into a strange css problem. I want all my links to have a dashed underline and when they are hovered, it must change to a solid line. Sounds...
25
3696
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's...
0
1099
by: unknown | last post by:
Hi, I am developing an online book store with shopping cart. My shopping cart is represented as a Xml server control and I am using an XSLT to render it at the client side. I am using an...
0
328
by: Kris Vanherck | last post by:
yesterday i started getting this strange error when i try to run my asp.net project: Compiler Error Message: CS0006: Metadata file 'c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net...
11
2568
by: Martin Joergensen | last post by:
Hi, I've encountered a really, *really*, REALLY strange error :-) I have a for-loop and after 8 runs I get strange results...... I mean: A really strange result.... I'm calculating...
20
1648
by: SpreadTooThin | last post by:
I have a list and I need to do a custom sort on it... for example: a = #Although not necessarily in order def cmp(i,j): #to be defined in this thread. a.sort(cmp) print a
14
3283
by: blumen | last post by:
Hi all, I'm a newbie in VB.Net Programming.. Hope that some of you can help me to solve this.. I'm working out to read,parse and save textfile into SQL Server. The textfile contains thousands...
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.