From www-style-request@www10.w3.org Wed Jan 29 20:49 MET 1997 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] [nil "Wed" "29" "January" "1997" "20:45:53" "+0100" "Hakon Lie" "howcome@www10.w3.org" "<199701291945.UAA16075@www4.inria.fr>" "62" "Re: Style sheet misuse advice" "^Resent-Date:" "john@htmlhelp.com, www-style@www10.w3.org, griffon@canit.se, liam@htmlhelp.com" "john@htmlhelp.com, www-style@www10.w3.org, Urban Fredriksson, Liam Quinn" "1" "1997012919:45:53" "Style sheet misuse advice" nil "<32fca44b.5322277@mail.gte.net>"] nil) Return-Path: www-style-request@www10.w3.org Received: from sophia.inria.fr by mygale.inria.fr (8.8.3/8.6.12) with ESMTP id UAA23572 for ; Wed, 29 Jan 1997 20:49:18 +0100 (MET) Received: from www19.w3.org by sophia.inria.fr (8.8.3/8.6.12) with SMTP id UAA21415; Wed, 29 Jan 1997 20:49:16 +0100 (MET) Received: by www19.w3.org (8.6.12/8.6.12) id OAA19951; Wed, 29 Jan 1997 14:47:09 -0500 Message-Id: <199701291945.UAA16075@www4.inria.fr> In-Reply-To: <32fca44b.5322277@mail.gte.net> References: <3.0.1.32.19970124004341.008c6940@undergrad.math.uwaterloo.ca> <32E893A6.2A51@canit.se> <32fca44b.5322277@mail.gte.net> Content-Transfer-Encoding: 8bit X-List-URL: http://www.w3.org/pub/WWW/Archives/Public/www-style/ X-Mailing-List: archive/latest/1702 X-Loop: www-style@w3.org Precedence: list Content-Type: text/plain; charset="iso-8859-1" Content-Length: 2368 Resent-Date: Wed, 29 Jan 1997 14:47:09 -0500 Resent-Message-Id: <199701291947.OAA19951@www19.w3.org> Resent-From: www-style@www10.w3.org Resent-Sender: www-style-request@www10.w3.org From: Hakon Lie Sender: www-style-request@www10.w3.org To: john@htmlhelp.com Cc: www-style@www10.w3.org, Urban Fredriksson , Liam Quinn Subject: Re: Style sheet misuse advice Date: Wed, 29 Jan 1997 20:45:53 +0100 (MET) John Pozadzides writes: > If one were to set Text and Link colors using a style sheet, should one > also define the background colors for these elements as well? Thanks for posting the question, it's an interesting one and should go into the FAQs. I'd say you should set give 'background' a value, but not necessarily a color value. E.g., if the document has a background image, you would "hi-light" all links if you give them a background color. BODY { background: url(light-texture.png) #FFF; color: #000 } A:LINK, A:VISITED, A:ACTIVE { color: #00F; background: transparent; } By setting the 'background' explicitly to 'transparent', you lower the risk of another rule in the cascade giving links a background that would hi-light them. The next question is: If 'background' and 'color' always should be set together, why do they exist as separate properties? There are serveral reasons for this. First, style sheets become more legible -- both for humans and machines. The 'background' property is already the most complex property in CSS1 and combining it with color would make it even more complex. Second, 'color' inherits, but 'background' doesn't and this would be a source of confusion. Third, in the discussions within the W3C HTML ERB this fall, several people wanted to split the compound properties into their smaller parts. The result was a number of new background-*, border-* and list-style-* properties. (BTW, Bert and I resisted these changes but lost) A meta-question that should also be asked is how to best write style sheets to accomodate cascading. From a forthcoming book on CSS, Here is one of around ten "guidelines" on how to write style sheets with style: Design to Accommodate Cascading Realize that some users will have personal style preferences when reading your documents. Write your style sheets so that a user's personal sheet will cascade gracefully with yours. You can help with this by setting properties in recommended places. Style rules that apply to the whole document should e.g. be set on the BODY element -- and only there. In this way, the user can easily modify document-wide style settings. Regards, -h&kon H å k o n W i u m L i e howcome@w3.org W o r l d Wide W e b Consortium inria §°þ#¡ª FRANCE http://www.w3.org/people/howcome