[thelist] CSS selectors

David Bindel dbindel at austin.rr.com
Thu May 27 14:23:30 CDT 2004


On Thu, 2004-05-27 at 14:14, Marcus Andersson wrote:
> Say I have a div like
> 
>   <div class="nodeContainer leaf">...</div>
> 
> and another div like
> 
> <div class="nodeContainer leaf last">...</div>
...
> /* The following selector is wrong but I wonder how I can (if possible) do it */
> div.tree div.leaf&&last {
>    styling stuff that overrides a couple of properties
> }
> 
> Is it possible? How do I do? Or do I have to add more elements to express what I want?

Why not just use the selector "div.tree div.last"?  As long as you can
ensure that the last leaf is the only element of class "last" inside of
a div of class "tree".

Are there elements besides last leaves that use the class "last"?  If
so, you could always change the class name to "lastleaf" or something
like that so they do not get confused.

HTH,
David Bindel

http://www.davidbindel.com



More information about the thelist mailing list