kate_rose Posted January 23, 2008 Share Posted January 23, 2008 Well you got the question from the subject line... I know I can do it in javascript with hotspots but was hoping for a more elegant solution. Thanks, Kate Quote Link to comment https://forums.phpfreaks.com/topic/87447-can-i-use-hover-to-change-the-content-of-another-div/ Share on other sites More sharing options...
phpQuestioner Posted January 23, 2008 Share Posted January 23, 2008 Well you got the question from the subject line... I know I can do it in javascript with hotspots but was hoping for a more elegant solution. Thanks, Kate so you only want to do this with css and no javascript; is that what your wanting? Quote Link to comment https://forums.phpfreaks.com/topic/87447-can-i-use-hover-to-change-the-content-of-another-div/#findComment-447337 Share on other sites More sharing options...
kate_rose Posted January 24, 2008 Author Share Posted January 24, 2008 I have just been so impressed with the ease of rollovers with the use of the hover command in CSS, I was just wondering if there was a way to make the hover command change the content of another div (other than that being hovered over). If not I can certainly do it with Javascript if you think it would be easier. Thanks, Kate Quote Link to comment https://forums.phpfreaks.com/topic/87447-can-i-use-hover-to-change-the-content-of-another-div/#findComment-447500 Share on other sites More sharing options...
bronzemonkey Posted January 24, 2008 Share Posted January 24, 2008 There is no way to do it across all browsers with css applied to the same html, because IE6 and below don't support the :hover pseudo-class on anything other than anchors. But you could do it for other browsers by applying :hover to other elements in the stylesheet and making sure that in the html the content to be revealed is contained within the element that is having the :hover pseudo-class applied to it in the css. .myclass .hidden {display:none;} .myclass:hover .hidden {display:block;} <ul> <li class="myclass"> <div class="hidden">You can't see me until you hover on my parent.</div> </li> </ul> Quote Link to comment https://forums.phpfreaks.com/topic/87447-can-i-use-hover-to-change-the-content-of-another-div/#findComment-447688 Share on other sites More sharing options...
kate_rose Posted January 24, 2008 Author Share Posted January 24, 2008 Thanks bronze. That helps. Quote Link to comment https://forums.phpfreaks.com/topic/87447-can-i-use-hover-to-change-the-content-of-another-div/#findComment-448096 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.