Re: [css-d] select .ygtvitem elements which do not have a .ygtvchildren ancestor

2008-07-13 Thread Bill Brown
Jack Bates wrote:
> I am trying to apply special style to all .ygtvitem elements which _do
> not_ have a .ygtvchildren ancestor. In CSS, it is easy enough to select
> all .ygtvitem elements which _do_ have a .ygtvchildren ancestor:
> .ygtvchildren .ygtvitem {
>   color: red
> }
> However I cannot figure out how to select those which _do not_ have
> a .ygtvchildren ancestor.
> For the time being, our workaround is to apply the "no .ygtvchildren
> ancestor" style to all .ygtvitem elements, and a different style to
> those .ygtvitem elements which _do_ have a .ygtvchildren ancestor:
> .ygtvitem {
>   color: black
> }
> .ygtvchildren .ygtvitem {
>   color: red
> }
> - however this is not ideal: We do not want to explicitly specify style
> for .ygtvitem elements which _do_ have a .ygtvchildren ancestor - we
> want then to inherit the cascaded style.
> How can I explicitly specify style for only .ygtvitem elements which _do
> not_ have a .ygtvchildren ancestor? What is the CSS selector
> for .ygtvitem elements which _do not_ have a .ygtvchildren ancestor?

Hi Jack--

You're looking for a parent selector, which intuitively, one might
expect to look something like this:
p < img {} /* Select all paras which have an image as a child */
...the reverse of...
p > img {} /* Select all images which have a para as a parent */

The problem is that there is no parent, or ancestor selector in CSS.

I've seen a few debates on whether or not there should be, or will
be...but for today, there is none.

That having been said, there are occasionally workarounds, but I'd need
to see it in context to be able to give you any real advice.

Do you have a link to a page we can look at to see the problem more clearly?

--Bill




-- 
/**
 * Bill Brown
 * TheHolierGrail.com & MacNimble.com
 * From dot concept...to dot com...since 1999.
 ***/
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


[css-d] select .ygtvitem elements which do not have a .ygtvchildren ancestor

2008-07-13 Thread Jack Bates
I am trying to apply special style to all .ygtvitem elements which _do
not_ have a .ygtvchildren ancestor. In CSS, it is easy enough to select
all .ygtvitem elements which _do_ have a .ygtvchildren ancestor:

.ygtvchildren .ygtvitem {
  color: red
}

However I cannot figure out how to select those which _do not_ have
a .ygtvchildren ancestor.

For the time being, our workaround is to apply the "no .ygtvchildren
ancestor" style to all .ygtvitem elements, and a different style to
those .ygtvitem elements which _do_ have a .ygtvchildren ancestor:

.ygtvitem {
  color: black
}

.ygtvchildren .ygtvitem {
  color: red
}

- however this is not ideal: We do not want to explicitly specify style
for .ygtvitem elements which _do_ have a .ygtvchildren ancestor - we
want then to inherit the cascaded style.

How can I explicitly specify style for only .ygtvitem elements which _do
not_ have a .ygtvchildren ancestor? What is the CSS selector
for .ygtvitem elements which _do not_ have a .ygtvchildren ancestor?

Thanks and best wishes, Jack

__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


[css-d] select .ygtvitem elements which do not have a .ygtvchildren ancestor

2008-06-17 Thread Jack Bates
I am trying to apply special style to all .ygtvitem elements which _do
not_ have a .ygtvchildren ancestor. In CSS, it is easy enough to select
all .ygtvitem elements which _do_ have a .ygtvchildren ancestor:

.ygtvchildren .ygtvitem {
  color: red
}

However I cannot figure out how to select those which _do not_ have
a .ygtvchildren ancestor.

For the time being, our workaround is to apply the "no .ygtvchildren
ancestor" style to all .ygtvitem elements, and a different style to
those .ygtvitem elements which _do_ have a .ygtvchildren ancestor:

.ygtvitem {
  color: black
}

.ygtvchildren .ygtvitem {
  color: red
}

- however this is not ideal: We do not want to explicitly specify style
for .ygtvitem elements which _do_ have a .ygtvchildren ancestor - we
want then to inherit the cascaded style.

How can I explicitly specify style for only .ygtvitem elements which _do
not_ have a .ygtvchildren ancestor? What is the CSS selector
for .ygtvitem elements which _do not_ have a .ygtvchildren ancestor?

Thanks and best wishes, Jack


signature.asc
Description: This is a digitally signed message part
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/