Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    wac
    wac is offline
    Regular Coder wac's Avatar
    Join Date
    Sep 2002
    Location
    Cary, North Carolina, USA
    Posts
    359
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Hilite LI in a UL list

    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?
    Wayne Christian

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Code:
    <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
    Last edited by beetle; 11-14-2002 at 07:48 AM.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    New Coder
    Join Date
    Dec 2002
    Location
    Florida
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey wac, take a look at this link:

    http://www.archomai.org/transMenus.php
    it has what you're looking for.

    MrDF

  • #4
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    li:hover {
    background-color: green;
    }

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •