- From: Alan Gresley <alan@css-class.com>
- Date: Mon, 17 Mar 2008 03:10:16 -0700
- To: fantasai <fantasai.lists@inkedblade.net>
- cc: www-style@w3.org, robert@ocallahan.org, Andrew Fedoniouk <news@terrainformatica.com>
fantasai wrote: > <div dir="rtl"> > <ul dir="ltr"> > <li>I would be selected by :ltr, and not by :rtl.</li> > </ul> > </div> > <div dir="ltr"> > <ul dir="rtl"> > <li>I would be selected by :rtl, and not by :ltr.</li> > </ul> > </div> > > If you want to write a selector that matches all elements with rtl > direction, you can't do it with a descendant combinator. > > ~fantasai You have provided a good test case Fantasai. http://css-class.com/test/css/selectors/attribute-dir3.htm I now understand the problem. It's not that I can't select with a descendant combinator but selecting like this can get out of hand. Andrews initial example was not revealing enough. http://css-class.com/test/css/selectors/attribute-dir2.htm So we have a selector like this. ul:rtl li { ... } This use case is to style a particular element that has a parent or ancestor with a particular 'dir' attribute. I see this similar to the problem with drop down menus and using a keyboard to access hidden submenus. <ul><li><a>Item 1</a> <ul> <li><a>SubItem 1.1</a></li> <li><a>SubItem 1.2</a></li> </ul> </li><ul> ul ul {display:none} a:focus+ul {display:block} When Item 1 is in focus the hidden list is revealed but when either of the SubItems are in focus the parent <ul> is hidden so in turn the SubItems are hidden also. The parent <ul> could only be revealed with such a selector. I know it silly and weird. ;-) a:focus<ul {display:block} If that was possible then this could be possible. *<[dir="rtl"], * *<[dir="rtl"] {background:lime} Now that I have seen the actual problem I will study the thread that has taken place. Alan http://css-class.com/test/
Received on Monday, 17 March 2008 10:10:59 UTC