Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6474083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:32:41+00:00 2026-05-25T06:32:41+00:00

Got a list with 3 items. Upon hovering over a item information shall be

  • 0

Got a list with 3 items. Upon hovering over a item information shall be displayed.
Works fine within same <DIV>.
How about displaying information from another <DIV>, I guess this should be possible, isn’t it?

Initially only the three lisitings are displayed.
When hovering over ‘listing 2’ the content of ‘#special’ can be displayed, no problem.

When hovering over ‘listing 3’ the content of ‘#AlsoSpecial’ is not displayed, Why?.
Is there a remedy?

Sample HTML:

<div id="top">
   <ul>
        <li class="left">listing 1</li>
        <li class="center">listing 2</li>
        <li class="right">listing 3</li>
        <li><div id="special">
            <p>bla1bla1bla1</p>
        </div></li>
    </ul>
</div>

<div id="content">
    <div id="AlsoSpecial">
        <p>bla2bla2bla2</p>
    </div>
</div>

Sample CSS:

#top > li {display:inline;}

/*this works fine*/
div#special {display:none;}
.center:hover div#special {display:block;}

/*this does not work, WHY?*/
div#AlsoSpecial {display:none;}
.right:hover div#AlsoSpecial {display:block;}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:32:41+00:00Added an answer on May 25, 2026 at 6:32 am

    When an element is sibling of another one, you should use the + selector.
    So, doing this should do it.-

    li:hover + div#special
    

    However, note that UL elements expect only LI elements inside, adding something different is illegal and you should not.

    I recommend you to place the DIV element inside of the element you want to hover.
    So a much better solution would be

    ...
    <li>text
        <div>contents</div>
    </li>
    ...
    

    …styled with the CSS selector.-

    li:hover > div#special
    

    Consider also using class=”special” instead of ID, if there is any posibility that you want to have more than one DIV reacting to that hover event… remember that IDs are unique and cannot be used in more than one element.

    If you want to make appear a div that is “unmatchable” with CSS, you would have to use Javascript, an example for doing this in Javascript here.-

    var toShow  = document.getElementById('alsoSpecial'),
        toHover = document.getElementById('toHover'), // ...for instance.
        showOrNot = function(e)
        {
            toShow.style.display = (e.type == 'mouseover')?
                'block': 'none';
        };
    toHover.addEventListener('mouseover', showOrNot, 1);
    toHover.addEventListener('mouseout',  showOrNot, 1);
    

    I typed the code on the fly and did not try it. I hope it works alright, if it does not work please let me know.

    Greetings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how would i got about doing something when hovering over a list item, but
I've got listbox that employs an item template. Within each item in the list,
I've got a list of items in an order to show in asp.net --
What I want to do is add and remove list items. I have got
I got a list that contains al the status items of each order. The
I've got the following code to output a list of items from amazon, but
you have some info on an item and you got a list of comment
In the project I'm working on I have got a list List<Item> with objects
I've got a list, and I have a click handler for its items: <ul>
I've got a ListView with a custom BaseAdapter. The list items contain CheckBoxes that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.