Click here to get back home

CSS: Problems with doubly defined colors (according to validator)

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
CSS: Problems with doubly defined colors (according to validator) Sebastian Schack 05-20-2007
Posted by Sebastian Schack on May 20, 2007, 5:26 pm
Please log in for more thread options


Hey everyone.

Hope I'm in the right spot here... if not, please correct me.

My .css starts with the definition of the body-part which looks as follows:

body {
background: #FFFFFF url(images/banner_spacer.png) repeat-x;
font: normal small Arial, Helvetica, sans-serif;
}

The validator complains about two other parts in my .css file, telling me
that I'm using the same color for the fore- and the background in the two
contexts body and .boxed .title and in the two contexts body and #topmenu
a.

Here's my .boxed .title part:
.boxed .title {
height: 29px;
padding: 11px 0 0 27px;
text-transform: uppercase;
font-size: 1.2em;
color: #FFFFFF;
}

And here the #topmenu a part:
#topmenu a {
display: block;
float: left;
margin: 0 0 0 20px;
padding: 0 0 0 15px;
text-transform: uppercase;
text-decoration: none;
font-size: x-small;
font-weight: bold;
color: #ffffff;
}

Well, most likely I'm just blind in this case... but I can't see what I am
doing wrong or how I could do this in a better way.

Anybody?

Thanks in advance.

Regards,
Sebastian

Posted by Beauregard T. Shagnasty on May 20, 2007, 5:55 pm
Please log in for more thread options


Sebastian Schack wrote:

> Hey everyone.

Hey.

> Hope I'm in the right spot here... if not, please correct me.
> My .css starts with the

How about a URL to a working example of your problem?


> #topmenu a {
...
> font-size: x-small;

I can't read that.

> font-weight: bold;

..and will be even worse when bold. I will probably have to increase the
text size in my browser by about 30% or so - and then the text will no
doubt escape from your explicitly-pixel-sized boxes.

--
-bts
-Motorcycles defy gravity; cars just suck

Posted by Jonathan N. Little on May 20, 2007, 6:32 pm
Please log in for more thread options


Sebastian Schack wrote:
> Hey everyone.
>
> Hope I'm in the right spot here... if not, please correct me.
>
> My .css starts with the definition of the body-part which looks as follows:

A url would be better, you may not have included the part with the error
but...

>
> body {
> background: #FFFFFF url(images/banner_spacer.png) repeat-x;
^^^^^^
This states that your *base* background color is white.

> font: normal small Arial, Helvetica, sans-serif;
> }
>
> The validator complains about two other parts in my .css file, telling me
> that I'm using the same color for the fore- and the background in the two
> contexts body and .boxed .title and in the two contexts body and #topmenu
> a.
>
> Here's my .boxed .title part:
> .boxed .title {
> height: 29px;
> padding: 11px 0 0 27px;
> text-transform: uppercase;
> font-size: 1.2em;
> color: #FFFFFF;
^^^^^^^^^^^^^^^
Now you have set the foreground color to white but what is the
background? You don't say so since your base color is white and and any
elements with class "boxed" or "title" will inherent the background
color of the parent your default will be white on white and hence the
warning. Yes I know you have a background image, but if it unavailable
for some reason the background color will preside. If this PNG is dark
you should set the background color dark as well for us folks on dialup
can read your page as your PNG takes it's merry time loading.

> }
>
> And here the #topmenu a part:
> #topmenu a {
> display: block;
> float: left;
> margin: 0 0 0 20px;
> padding: 0 0 0 15px;
> text-transform: uppercase;
> text-decoration: none;
> font-size: x-small;
> font-weight: bold;
> color: #ffffff;
^^^^^^^^^^^^^^^
         DITTO

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Posted by Sebastian Schack on May 21, 2007, 1:50 pm
Please log in for more thread options


Jonathan N. Little wrote:

> A url would be better, you may not have included the part with the error
> but...
>

Yeah, sorry.
The website's still in the alpha phase and looked that shabby, I didn't dare
to upload it last night. ;)
However, here it is (with no content and no function):
http://www.schacknetz.de
http://www.schacknetz.de/default.css

>>
>> body {
>> background: #FFFFFF url(images/banner_spacer.png) repeat-x;
> ^^^^^^
> This states that your *base* background color is white.
>

Right. As intended.

>> Here's my .boxed .title part:
>> .boxed .title {
>> height: 29px;
>> padding: 11px 0 0 27px;
>> text-transform: uppercase;
>> font-size: 1.2em;
>> color: #FFFFFF;
> ^^^^^^^^^^^^^^^
> Now you have set the foreground color to white but what is the
> background? [...] Yes I know you have a background image, but if it
> unavailable for some reason the background color will preside. If this PNG
> is dark you should set the background color[...]
>

Well, your right, I have a background image. But it doesn't cover the whole
page.
So when I change the background color to, let's say, black, half of the
page's background will be black.

Please take a look at the page and the css as well.
Feel free to comment/ correct me wherever I am|might be wrong. :)

Thanks in advance!

Posted by Sebastian Schack on May 21, 2007, 1:59 pm
Please log in for more thread options


Strange things are happening!

I felt free so free to already include the links to both, the (X)HTMl and
the CSS validator.
Now I'm really surprised: I didn't change a thing in the CSS file since
posting to the newsgroup in search for help. When you click on one of the
links (right at the bottom) both, the page itself and the css file are
being validated.

However, if I upload my local default.css to the validator of www.w3.org, it
shows me the same "mistakes" as before.
The files are exactly the same (I just used diff to verify).

Who's wrong now?
Is my CSS okay and the validator is somewhat confused?

Regards,
Sebastian

Similar ThreadsPosted
XHTML 1.0 Validator: No attributes, elements not defined... August 11, 2004, 3:21 am
PHP pages, problems with W3C Validator Local installation on Windows January 21, 2006, 7:36 am
Forms: Where is the character encoding (eg. UTF) defined? October 29, 2004, 3:32 pm
"force" user to use site in defined order? April 1, 2008, 1:54 am
Problem with xhtml Validator at http://validator.w3.org/ July 27, 2005, 5:06 am
Links colors in xhtml. March 23, 2005, 1:56 pm
HTML safe colors July 20, 2007, 4:23 pm
change link colors in p class September 30, 2004, 6:18 pm
Composition of text and background colors. March 28, 2005, 9:58 am
IE6 link colors & CSS override (vs. Firefox) October 20, 2005, 9:06 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap