Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the following code I am able to show the image in class '.location1' when the mouse house hovers commonly at the last ul. Actually I want to show the image in class 'location1' , only when the mouse hovers on 'location' text li id='smap'.
CSS
.imageBox1 ul li ul .location1
{
 display:none;

}
.imageBox1 ul li ul:hover>.location1
{
display:block;
position:absolute;

}



XML
<div class="imageBox1">
 <ul>
 <li class="img1"><img src="apt1.jpg" /><br>
 <span style="font-size:large; text-align:center; font-weight:bold;">Vasans Riveria-RS Puram</span>
  <ul>
 <li id="smap"><a href="#" > <span style="color:Silver;  ">Location</span></a></li>
 <li class="location1"><img src="twobhksitemap.jpg"  style=" width:120px; background-color:Blue"/></li>
 <li><a href="two_bhk_floorplan.aspx"<span style="color:Silver;">2 bhk plan</span></a></li>


...
Posted

1 solution

Use attribute selectors in your CSS: https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors[^]
CSS
.imageBox1 ul li[id="smap"] ul .location1
 
Share this answer
 
Comments
S.Rajendran from Coimbatore 21-Dec-14 6:36am    
i tried like this not working:
imageBox1 ul li ul[id="smap"]:hover >.location1
Kornfeld Eliyahu Peter 21-Dec-14 6:45am    
You are talking about li element with id smap, but look for ul element with id smap in your CSS...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900