display a div while another div is hovered with position: fixed - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover

Description

display a div while another div is hovered with position: fixed

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
#parent {<!--from w w w  . j a  v a2  s.c  o  m-->
   position:fixed;
   top:0px;
   text-align:right;
   height:33px;
   width:100%;
}

#msg {
   position:absolute;
   right:35px;
   display:none;
}

#img:hover + #msg {
   display:block;
}
</style> 
 </head> 
 <body> 
  <div id="parent"> 
   <div id="img"> 
    <a href="some link here"> <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> </a> 
   </div> 
   <div id="msg">
     Lorem ipsum dolor sit amet, consectetur 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials