Steel wrote:
I simply need to match the father (<li>) af a <a> that can have the href or
not
In my menu only the last choice-level have the href but I do not know how
many level are nested.
Steel
CSS cannot differ between elements of the same type unless they have
different class, id or is unique in that it is the only node within its
hiearchy and the node is known before the page is rendered.
Examples:
<ul>
<li><a class="link"> 1
<li><a class="link"> 1
<li><a class="link"> 1
<li><a class="link" id="somelink"> 1,2
<li><a id="lastlink"> 3
<ul>
<li><a> 4
</ul>
</ul>
1: Styles defined as a.link {} will apply to all with the class="link"
2: Syles defined as a#somelink {} will only apply to an <a> with
id="somelink". The id style wins over class style in a conflict.
3: The style #lastlink will only apply to the <a> with id="lastlink"
4: The style ul li ul li a {} will only apply to <a> inside a <li>
inside a <ul> inside a <li> inside a <ul>
If your page is generated by a script, you can assign a class or id to
the different elements you want to apply special effects to. Otherwise
you must probably use a client side javascript that browses through the
DOM and do the changes there. I am not proficient enough with javascript
to tell you how.