...

Hilite LI in a UL list

wac
11-13-2002, 10:58 PM
I'm using UL list to simulate a fully expanded tree. I use css to change the bullet to images. This works well except that I also want to hilite a specific item on mouseover. Unfortunately,
if there's a subordinate UL under an LI, then the entire subtree gets hilited instead of just the single row.
(example)
<UL>
<LI>item 1
<LI>item 2 <!-- hilite this item and both item 2 and 3 are hilited -->
<UL>
<LI>item 3
</UL>
</UL>
I tried wrapping the text in a SPAN and hiliting that, but apparently SPAN doesn't have a background color???!!!

Any suggestions?

beetle
11-14-2002, 07:46 AM
You should be able to alter the backgroundColor of a SPAN.

Can I see more code or get a link?

Oh, and the reason all that get's highlighted is because in proper HTML, that structure looks like this<li>Nested
<ul>
<li>nested 1</li>
<li>nested 2</li>
</ul>
</li>As you can see, the entire subtree IS part of the LI :D

MrDoubtFire
12-06-2002, 12:16 AM
hey wac, take a look at this link:

http://www.archomai.org/transMenus.php

it has what you're looking for.

MrDF

jkd
12-06-2002, 01:39 AM
li:hover {
background-color: green;
}

Works in Mozilla, Konqueror, and Opera 7 as far as I know.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum