Forum Moderators: not2easy
want to give an effect to a <li> only if it contains another <ul>
The short answer is no.
The long answer is that C(ascading)SS works from the top of the document tree down. There's no way to use CSS alone to move up that document tree, which is what your application would require.
First, it would have to read through the document tree in order to identify whether a given LI contains a UL. This part is very easy...
li ul{propery:value;}
...does that. The problem is the second part, where the browser is asked to take it's newfound knowledge of the child UL's presence, and move back up the tree to apply styles to the LI it's just read past. Sadly, that's a no-can-do in CSS.
I would suggest either (a) use JS,(c) detect the UL on the server side with PHP or ASP and have it apply a class or inline style to the element, or (c) manually tag any LI containing a UL with a class name and apply the styles to that.
cEM