> ...which my shaky understanding suggests means hide all elements that
> are not descendants of TheDivToShow, and the separately show
> TheDivToShow as a block element.  But even if I have the syntax right,

Doh!  But all of TheDivToShow's *ancestors* would also have to be
visible for that to work.  So unless the target div is at the top
level under <body>, it's going to get ugly fast...

But if it *is* at the top level, then as Alex points out, if you can
put everything else in a div or divs:

<body>
<div><!-- everything before it --></div>
<div id='TheDivToShow'>...</div>
<div><!-- everything after it --></div>
<div><!-- there might be several of these --></div>
</body>

...this should do it:

  div {
    display: none;
  }
  #TheDivToShow, #TheDivToShow div {
    display: block;
  }

-- T.J.

On Sep 23, 4:18 pm, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
> My first impression was that Alex's idea of a print stylesheet was
> brilliantly simple, but alas, CSS lacks the concept of "re-apply the
> default for this element type" (e.g., "display: auto", which doesn't
> exist as far as I know), so even with descendant selectors (so you can
> hide everything but then show the div and its descendants), it doesn't
> work because as Peter points out, not everything wants to be "display:
> block".
>
> CSS3 has a negation operator, so in theory you could say:
>
>   *:not(#TheDivToShow *) {
>     display: none;
>   }
>
>   #TheDivToShow {
>      display: block;
>   }
>
> ...which my shaky understanding suggests means hide all elements that
> are not descendants of TheDivToShow, and the separately show
> TheDivToShow as a block element.  But even if I have the syntax right,
> I doubt it's well-enough supported to be useful at the moment.
> --
> T.J. Crowder
> tj / crowder software / comwww.crowdersoftware.com
>
> On Sep 23, 3:05 pm, Peter De Berdt <peter.de.be...@pandora.be> wrote:
>
>
>
> > On 23 Sep 2009, at 15:50, Alex McAuley wrote:
>
> > > Bill you can...
>
> > > div {display:none;} /* Hide all divs */
>
> > > div.classNameThatYouWantDisplayed {
> > > display:block
> > > }
>
> > > Nice and easy
>
> > Not really, since there might be divs in the floating window div,  
> > those will also be hidden and even if you would use the * selector,  
> > there might be elements within that div that shouldn't be block level  
> > elements.
>
> > The only way I see, is wrapping all other content in a div, then  
> > hiding that one. That is assuming that the floating window div is  
> > inserted at the end of the <body> element and not in the middle of the  
> > other content (most lightbox like scripts will do it that way).
>
> > Best regards
>
> > Peter De Berdt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to