Thanks Georg, I'll take a look.

I have finally managed to achieve my original objective by using direct child selectors all the way from the <nav> element, thus: 'nav > ul > li > ul ...' That prevents 'ul > li > ul' also selecting ' 'ul > li > ul > li > ul'. Without the 'nav' at the beginning to tell it where to start the selector is greedy and will start anywhere in the chain. My initial mistake was not to recognise that.

I've also made it work with classes at each level, though I suspect that one class at the first level would be sufficient, once again giving a firm start point.

On balance I think I prefer classes at each level. It makes the code easier to follow, which as we all know is important in six months time. It's easy to lose one's place in the chain of ul and li selectors.

It's been an interesting exercise.

Regards,

Tim Dawson




On 16/10/2018 02:24, Georg wrote:

I have been trying to avoid using classes here, using direct child selectors instead. Maybe that's ill advised?

It would appear that when I hover 'ul > li > ul' it's also selecting 'ul > li > ul > li > ul'. which I thought it should not. That's the only way I can account for both transitions being started by one hover (though it doesn't explain why they appear to be sequential rather than simultaneous).

You can achieve what you want by using "Structural pseudo-classes"...

See: <https://www.w3.org/TR/2018/PR-selectors-3-20180911/#structural-pseudos>

Check the examples in that page to find what suits the purpose best.

regards
         Georg
______________________________________________________________________
css-discuss [css-d@css-discuss.org]
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/

--
Tim Dawson
Maolbhuidhe
Fionnphort
Isle of Mull  PA66 6BP

01681 700718
______________________________________________________________________
css-discuss [css-d@css-discuss.org]
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/

Reply via email to