For years, to help me with my developing I've set my browser font and color setting to something weird to that I can catch myself if I forget to declare them and as such often come across some pretty big sites that don't. I'm still not sure if I'm being too anal or if everyone else just isn't been as thorough. I usually sit there with a self satisfied smug grin on my face for a little while and then go about my business realizing that I really need to get a life of my own before criticizing others.
That said, I've noticed that this site hasn't declared it's body background color and seeing as this is a place for such discussions - Am I just too anal or is the smug grin justified?
I don't understand why you
I don't understand why you insist that there is something wrong with a web site that doesn't override your own preferences. If I like a blue background on everything and prefer to read everything in "comic-sans MS" why should a web site tell me differently? Who are web sites for, the designer or the reader?
Personally I go so far as to specify a background color (usually white or close to it) and suggest sans-serif fonts for body text and serif fonts for headlines. Then I try to make my site look right if the user prefers something different.
There is more reason to specify colors since modern browsers can display pretty well any color fairly correctly and we want sufficient contrast between text and background, and colors are a nice way to give a branding to our sites.
But the fact is that anyone with Greasemonkey can chage your choices all around anyway, and it's a very popular extension to Firefox that many folks have.
As a web browser, why do you care about whether someone's site is doing things "correctly" as long as it works with your preferred defaults? It seems a bit perverse to purposely choose defaults that you hate just so you can be critical of other people's web pages! There's enough pages out there that won't work with reasonable defaults - why pile up troubles?
Just my opinion...
Don't take my comment as a
Don't take my comment as a slight on people's personal preferences. Although my original posting might imply otherwise I don't really sit there criticizing other peoples work all the time.
My point is that when people design with a white background in mind they assume the default of their browser, yet when they design with a different color they have no problem in define it.
As you say, allowing people to set their own color/fonts browser width, etc. is noble, but we spend a lot of time designing websites and coming up with color schemes. We create background images to round corners and provide beautiful gradients that just fail if the background color was wrong.
Logos with white matting should have a white background color. As an example, Yahoo until just recently looked hideous without a white background, but I suspect they were ignorant to the fact rather than being user friendly.
Well, there are a lot of
Well, there are a lot of truly bad sites out there, many of them done by really big enterprises that should know better. About all we can do is make sure our sites work for the people that use them, and that's not a trivial achievement.
If you look at the top of the style sheet called style.css you will see I have set in body, background-color:#FFF;
I am not a designer so I like to keep the look of the site simple and I quite like white as a background color.
From the body other child elements inherit the background-color unless you specifically override it, which I have done in a couple of places.
Tony, to be a bit anal my
Tony, to be a bit anal my ownself, the background color defaults to "transparent" so that, as W3C puts it, "… the underlying colors shine through".
Sperks, the reason to specify a background color is to ensure that it is the correct color for the foreground color. And vice versa. Anytime you specify one, you should specify the other. If you haven't made a change, the foreground color is inherited from its parent, and the parent's (or grandparent's or great gra…) background color "shines through". If the user decides to override your stylesheet, it's his responsibility. But, if his default background hides your font color because you failed to set the bg, well, that's on you.
Two interesting comments
Two interesting comments there Tony and Gary.
Gary: that makes perfect sense. As I'm often told by validators, if I stipulate color, I should stipulate background-color and so vis versa only makes sense. If the inheritance is to allow the browsers default to be used that's a valid choice.
Tony: I'm with you in that I'm not a designer either. I love to take the designs of others and make them work. However, your comment about the background-color has me intrigued as it's getting ignored with both my IE and FF on my PC. I looked at your css and you have the following for your body: background-color: #fff; background:url(images/grade.png) repeat-x; background-position:0 20px;
A cleaner would have been:
or condensed to:
background: #fff url(images/grade.png) repeat-x 0 20px;
I didn't know that a mixture of the two produced an ill effect.
Your correct that it would have been cleaner to specify the background styles differently. That's just me rushing things.
What makes you think that the background-color is being ignored?
Or what is the ill effect?
In my "options" in both IE
In my "options" in both IE and FF I state that my browser should use gray and black for the background/font colors. This is always overridden by a site's declaration of other colors to use, but on this site my background color is staying as gray. After playing with the css I'm seeing that it's failing to set the background-color unless the background-color is declared after the more generic background attribute.
background:url(images/grade.png) repeat-x; background-position:0 20px;
should probably be:
background: #fff url(images/grade.png) repeat-x 0 20px;
I've never noticed this before btw.
That's an interesting observation.
Both the background-color property and the background shorthand property are valid even without declaring all the shorthand values.
What may be happening is the background property is overriding the previous background-color property using the initial value of transparent.
So when you set the background option in your browser it is overriding the default transparent or not declaired setting for the background property.
I will have to clean up my stylesheet and play around for a while.
Looks like my last post was pretty well spot on.
I have uploaded the stylesheet with the background property before the background-color and you should now see a white background.
It was an interesting experiment.