473,382 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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

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
May 20 '07 #1
6 2051
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
May 20 '07 #2
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
May 20 '07 #3
Scripsit Sebastian Schack:
Hope I'm in the right spot here... if not, please correct me.
You aren't. This group is about HTML, not CSS. The c.i.w.a.stylesheets group
is just around the corner. But before posting the question there, read the
responses here, re-read the warning message(s) you got, and - should you
need to post - don't forget the URL.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

May 20 '07 #4
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!
May 21 '07 #5
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
May 21 '07 #6
Sebastian Schack <se**************@gmail.comwrites:
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?
The "direct link" does a check without warnings. The two colour
warnings you get when you go to the w3c validator page can be turned
off (by setting the validators's options) and then you will get the same
output from both methods.

--
Ben.
May 22 '07 #7

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

Similar topics

6
by: timmy_dale12 | last post by:
hi im am trying to make a soccer stadium with a table and some buttons : <html> <head> <link rel="stylesheet" type="text/css" href="h:diverse/stadion.css" /> </head>
5
by: Timothy Madden | last post by:
Hello I have found in CSS2 specification that the color of table columns is not specificaly affected by setting the color property on COL elements (unlike width, for example). Now this table...
17
by: Eric Lindsay | last post by:
Is learning to write CSS a better use of time than finding and using a package that produces complete web pages? I've moved to a new platform (Macintosh), taking with me about 400 personal web...
5
by: Woodmon | last post by:
Example of my CSS follows: <style type="text/css" media="screen"> BODY { color: white } A:link { color: 66CCFF; } A:visited { color: CC66FF; } A:active { color: CC66FF; } A:hover {...
2
by: Ed Mullen | last post by:
Ok, I get the thing about specifying color and background-color together. So I specify: background-color: transparent; in my CSS file. And I still get the warning. The CSS file is: ...
4
by: Enrika | last post by:
Greetings! I'm working on a CSS drop-down menu, which, to my surprise, is actually working, more-or-less, in both IE *and* Firefox (and Netscape). But there are two changes that I want to make that...
36
by: Giggle Girl | last post by:
Hello! :) I am working on an app that uses dozens of tables, some with hundreds (or even thousands!) of rows. I am interested in formatting the tables using as much CSS as possible, so the HTML...
7
by: wolfing1 | last post by:
Is there a way to see what CSS classes in a page are not defined? (like if I want to find mispelled class names, etc)
158
by: Roedy Green | last post by:
The TopStyle people seem to have lost interest in their product. It does not work in Vista. I would like to find a replacement/replacement that did the following 1. let me compose CSS using a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.