|
To answer your question, there is no such thing as an "everything-but-x" selector that's broadly supported. The closest you're going to get is
* { attribute: value; etc.; }
#exception { attribute: reset_value; etc.; }
CSS3 does support *:not(#exception) { attribute: value; } which does exactly the same thing as the preceding two rules combined, but I've never seen it in the wild.
Whoa. Before I (or anyone else) can hope to help you, you should probably explain why you're attempting to clobber the layout properties of the entire browser canvas (which would be the expected practical consequence of specifying body { display: none; }), assuming such an attr-val pair would be rendered... and in nine years of using CSS, I've never run across a situation in which I found that to be a necessary step. This assumes, of course, that you haven't already (see below).
(Yes, nine years. Grab my RL name from my profile and Google it.)
If you simply want .article to display while stashing everything else away (as might be the case if you're putting together a print stylesheet), then leave body untouched, and do the following:
body * { display: none; }
.article { display: block; margin: as_necessary; }
In point of fact, you should either have one article per document, or (if that's not possible) a container called #articleset (or whatever; I'd use #bodyCopy myself) that would contain nothing but elements that have been assigned to the class article. Doing so will increase the specificity of the selector you use to enforce the presentation requirement you described. Classes are more specific than single elements by one order of magnitude; ID's are more specific by two orders of magnitude. The unversal selector has no discrete specificity assigned, but overrules the browser's stylesheet.
Last edited by persist1; 07-01-2007 at 08:54 PM..
Reason: Wanted to explain the unviersal selector.
|