Jump to content

CSS javascript image hover on mouse


kayz100

Recommended Posts

Hi guys,
Please help, my css image enlarge on mouse hover is not behaving. The main div is failing to center even though I have used margin:0 auto; I want it to enlarge image on hover without adjusting other div elements. I would love it to enlarge image with text, tried using javascript but no success.
 
<html> 
<head> 
<style type="text/css">
.myimg {
    position:relative;
    width:50%;
    top:0px;
}


.myimg:hover {
    width:80%;
    z-index:9999;
}


.Enlrg ul {clear:both; list-style-type:none; }


.Enlrg li {width:20%;
float: left;
overflow:visible;
display: block;
}
</style> 
</head> 


<body>


<div style="margin:0 auto; background:gray; width:80%;">
  <div class="Enlrg">
   <ul>
      <li><img class="myimg" src="pic1.jpg" alt="Rocasa Future classroom" /></li>
 <li><img class="myimg" src="pic2.jpg" alt="Rocasa Future classroom" /></li>
 <li><img class="myimg" src="pic3.jpg" alt="Rocasa Future classroom" /></li>
   </ul>
  </div>
</div>

</body></html>

 

 

Link to comment
https://forums.phpfreaks.com/topic/286719-css-javascript-image-hover-on-mouse/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.