I have an unordered list (ul) with some list items (li). One of this have another unordered list inside (ul). Now, I want to se to all these li the same stylesheet, except for the li that have another unordered list inside.
<ul>
<li>Element</li>
<li>Another Element</li>
<li>Special Element
<ul>
<li>Child</li>
<li>Child</li>
</ul>
</li>
</ul>
How can I set CSS without set a specific class for the special li?
In the current CSS specs, this is not possible. There is no selector for “an element that contains some specific content”. It may be possible in CSS4, but as of now, you will have to take special measures to single out the “special” li.
and give class
.specialelementa style of its own.