Zophar's Message Domain

Go Back   Zophar's Message Domain > General Chat > Talk of the Town

Reply
 
Thread Tools Display Modes
Old 08-10-2006, 08:04 PM   #1
packardmelan
Senior Member
 
packardmelan's Avatar
 
Join Date: Aug 2002
Location: Louisville, KY
Posts: 707
Default CSS Background color issues.

Okay, so, I was working on validating a CSS file. I didn't write it, but I wanted to do what I could to rework everything necessary so the W3C validator reported no errors, and no warnings.

I ALMOST succeeded. But the last warning I have left, is this:

Line : 322 (Level : 1) You have no background-color with your color : a:visited

Now, it's a bit of a catch all. Every anchor that hasn't been handled elsewhere uses a specific font color. I guess it's a bit of a shortcut, but I can't blame the guy for doing it.

However, I did go in and say:

background-color : transparent;

Now, from what I've Googled, and from W3C Schools... that *should* be fine. "transparent" seems to be a valid option for a background/background color.

Yet the error remains.

If I assign it a real color, say, #fff, then it throws off all the parts of the page that have different-colored backgrounds. Do I have to go back in and find these spots, and specify a:visited for each of them? Do I live with the warning?
<P ID="signature">http://www.sloganizer.net/en/</a></P>
__________________
...a man's reach should exceed his grasp, or what's a heaven for? -- Robert Browning
packardmelan is offline   Reply With Quote
Old 08-10-2006, 08:08 PM   #2
king killa
Senior Member
 
Join Date: Jun 2002
Posts: 2,124
Default Re: CSS Background color issues.

it validates for #fff but not transparent? That's fucked up.

and I hate three character color codes.. just a side note.
<P ID="signature">http://hwody.comKilla's Blog</a></P>
king killa is offline   Reply With Quote
Old 08-10-2006, 08:47 PM   #3
MonsieurSirhan
Senior Member
 
Join Date: Nov 2004
Posts: 429
Default Re: CSS Background color issues.

background-color is not a required element. Perhaps there is an emtpy value there you missed, like planly background-color: ; or some glitch like that.

Care to post the code block of that?
<P ID="signature">_- | -_
</P><P ID="edit"><FONT class="small">Edited by MonsieurSirhan on 08/10/06 03:48 PM.</FONT></P>
MonsieurSirhan is offline   Reply With Quote
Old 08-10-2006, 11:24 PM   #4
Ugly Joe
Senior Member
 
Ugly Joe's Avatar
 
Join Date: Dec 2003
Posts: 1,461
Default Re: CSS Background color issues.

The issue with this warning http://www.w3.org/Search/Mail/Public...&search=Searchhas been brought up before</a>. Ultimately, the validator is saying that transparent, while a valid value, is not a valid color (which is true, since it's an absence of color). This could lead to a very bad situation in which the anchored text is in front of a low contrast background. That's your warning: if this text gets placed over a background of the identical color, you will not see it.

I suppose, to be thorough, any class or id or element that has a background attribute should have a matching CSS parameter for any contained anchors. Yes, it's anal, but then you'd know that you'll never end up with "invisible" links. Also bear in mind that this is an automatic validator (which will be anal with its report) coded by the W3C (who get paid (or not paid, whatever) to be anal about standards compliance).

The global catch-all a:visited tag is lazy design, plain and simple. However, it's still very functional design. For a stylesheet that you didn't write that goes along with a web app that you didn't code, I'd say you've done more than enough. It's just a warning, afterall.
<P ID="signature">___________________________________ ____
</P>
__________________
Ugly Joe is offline   Reply With Quote
Old 08-10-2006, 11:54 PM   #5
packardmelan
Senior Member
 
packardmelan's Avatar
 
Join Date: Aug 2002
Location: Louisville, KY
Posts: 707
Default Re: CSS Background color issues.

> and I hate three character color codes.. just a side note.

Heh, I only use it to replace "black" and "white". It's lazy, sure, but I know what I mean by it.

<P ID="signature">http://www.sloganizer.net/en/</a></P>
__________________
...a man's reach should exceed his grasp, or what's a heaven for? -- Robert Browning
packardmelan is offline   Reply With Quote
Old 08-11-2006, 12:30 AM   #6
packardmelan
Senior Member
 
packardmelan's Avatar
 
Join Date: Aug 2002
Location: Louisville, KY
Posts: 707
Default Re: CSS Background color issues.

That was some good info; thanks for that.

I guess, in the long run, it would be good for me to completely fix the CSS - just so I could prove to myself that I CAN fix a CSS file so it validates completely. But at the same time, I'm very pleased to find out I'm not the only one complaining about this, ah, warning.
<P ID="signature">http://www.sloganizer.net/en/</a></P>
__________________
...a man's reach should exceed his grasp, or what's a heaven for? -- Robert Browning
packardmelan is offline   Reply With Quote
Old 08-11-2006, 12:33 AM   #7
packardmelan
Senior Member
 
packardmelan's Avatar
 
Join Date: Aug 2002
Location: Louisville, KY
Posts: 707
Default Re: CSS Background color issues.

> background-color is not a required element.

According to the auto-validator, if you have a 'color' element, you must also have a background-color or background element to match it. It displays fine in a webbrowser; but I wanted to make sure the validation services okayed everything.

That said, it DOES say the CSS file is valid - and a whopping ONE warning noted seems to suggest my work is done, as far as 'fixing' everything.
<P ID="signature">http://www.sloganizer.net/en/</a></P>
__________________
...a man's reach should exceed his grasp, or what's a heaven for? -- Robert Browning
packardmelan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:25 AM.

Contact Us - Zophar's Domain - Archive - Top

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.