Advertisement
apl-mhd

Image hover

Aug 20th, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.88 KB | None | 0 0
  1. https://drive.google.com/open?id=1rRE0zPC_K4Jkhlbu3h-EP0Rli4k_h2YM
  2.  
  3.  
  4.  
  5. <!DOCTYPE html>
  6. <html lang="en">
  7. <head>
  8.     <meta charset="UTF-8">
  9.     <title>Title</title>
  10.      <meta name="viewport" content="width=device-width, initial-scale=1">
  11.      <!--
  12.    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  13.    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  14.    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  15. -->
  16.  
  17.     <link rel="stylesheet" href="css/style.css">
  18.  
  19.     <style type="text/css">
  20.        
  21.  
  22. *{
  23.     padding: 0;
  24.     margin: 0;
  25.     text-decoration: none;
  26.     list-style: none;
  27.     font-family: sans-serif;
  28. }
  29.  
  30.  
  31.  
  32.  
  33. .maindiv{
  34.  
  35.     width: 1280px;
  36.     min-height: 500px;
  37.     background-color: #1abc9c;
  38.     margin: 0 auto;
  39.  
  40.     display: flex;
  41.     flex-direction: row;
  42.     flex-wrap: wrap;
  43.  
  44.     justify-content: center;
  45.  
  46. }
  47.  
  48. .maindiv .box{
  49.  
  50. position: relative;
  51. width: 300px;
  52. height:300px;
  53. background-color: #ff0;
  54. margin: 10px;
  55. box-sizing: border-box;
  56. display: inline-block;
  57.  
  58.  
  59.  
  60. }
  61.  
  62.  
  63.  
  64. .maindiv .box .imgbox{
  65. position: absolute;
  66.  
  67. width: 100%;
  68. height: 100%;
  69. overflow: hidden;
  70.  
  71. }
  72.  
  73.  
  74. .maindiv .box .imgbox img{
  75.    
  76.   max-width: 100%;
  77.   height: 100%;
  78.  
  79. }
  80.  
  81. .maindiv .box:hover img{
  82.  
  83.     transform: scaley(1.2);
  84.     transition: 2s;
  85.    
  86.     }
  87.  
  88.  
  89. .details{
  90.     position: absolute;
  91.     top:20px;
  92.     bottom:10px ;
  93.     left:10px ;
  94.     right:10px;
  95.     color: #fff;
  96.     text-align: center;
  97.     transform: scale(0);
  98.     transition: transform .7s;
  99.     background-color: rgba(0,0,0,.8);
  100. }
  101.  
  102. .details .content{
  103.     position: absolute;
  104.     top: 50%;
  105.    
  106.     transform: translateY(-50%);
  107.     text-align: center;
  108.     padding: 15px;
  109.  
  110. }
  111.  
  112. .maindiv .box:hover .details{
  113.     transform: scale(1);
  114.  
  115.  
  116. }
  117.  
  118.  
  119. .details .content h2{
  120.  
  121.     margin: 0;
  122.     padding: 0;
  123.     font-size: 20px;
  124.     color: #ff0;
  125.  
  126.  
  127. }
  128.  
  129.  
  130. .details .content p{
  131.  
  132.     margin: 10px 0 0;
  133.     padding: 0px;
  134.  
  135. }
  136.  
  137.  
  138.  
  139.  
  140.     </style>
  141.  
  142. </head>
  143. <body>
  144.  
  145.  
  146.  
  147.    
  148.  
  149.     <div class="maindiv">
  150.         <div class="box">
  151.             <div class="imgbox">
  152.                 <img src="img/1.jpg">
  153.             </div>
  154.         <div class="details">
  155.             <div class="content">
  156.                 <h2>wht is lorem ispsum?</h2>
  157.                 <p>It is a long established fact that a reader will be distracted by the readable like readable English. Many desktop publishing a </p>
  158.             </div>
  159.         </div>     
  160.         </div>  <!--End box-->
  161.  
  162.         <div class="box">
  163.             <div class="imgbox">
  164.                 <img src="img/1.jpg">
  165.             </div>
  166.         <div class="details">
  167.             <div class="content">
  168.                 <h2>wht is lorem ispsum?</h2>
  169.                 <p>It is a long established fact that a reader will be distracted by the readable like readable English. Many desktop publishing a </p>
  170.             </div>
  171.         </div>     
  172.         </div>  <!--End box-->
  173.  
  174.  
  175. <div class="box">
  176.             <div class="imgbox">
  177.                 <img src="img/1.jpg">
  178.             </div>
  179.         <div class="details">
  180.             <div class="content">
  181.                 <h2>wht is lorem ispsum?</h2>
  182.                 <p>It is a long established fact that a reader will be distracted by the readable like readable English. Many desktop publishing a </p>
  183.             </div>
  184.         </div>     
  185.         </div>  <!--End box-->
  186.  
  187.         <div class="box">
  188.             <div class="imgbox">
  189.                 <img src="img/1.jpg">
  190.             </div>
  191.         <div class="details">
  192.             <div class="content">
  193.                 <h2>wht is lorem ispsum?</h2>
  194.                 <p>It is a long established fact that a reader will be distracted by the readable like readable English. Many desktop publishing a </p>
  195.             </div>
  196.         </div>     
  197.         </div>  <!--End box-->
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.         <div class="box">
  205.             <div class="imgbox">
  206.                 <img src="img/1.jpg">
  207.             </div>
  208.         <div class="details">
  209.             <div class="content">
  210.                 <h2>wht is lorem ispsum?</h2>
  211.                 <p>It is a long established fact that a reader will be distracted by the readable like readable English. Many desktop publishing a </p>
  212.             </div>
  213.         </div>     
  214.         </div>  <!--End box-->
  215.  
  216.         <div class="box">
  217.             <div class="imgbox">
  218.                 <img src="img/1.jpg">
  219.             </div>
  220.         <div class="details">
  221.             <div class="content">
  222.                 <h2>wht is lorem ispsum?</h2>
  223.                 <p>It is a long established fact that a reader will be distracted by the readable like readable English. Many desktop publishing a </p>
  224.             </div>
  225.         </div>     
  226.         </div>  <!--End box-->
  227.  
  228.  
  229. <div class="box">
  230.             <div class="imgbox">
  231.                 <img src="img/1.jpg">
  232.             </div>
  233.         <div class="details">
  234.             <div class="content">
  235.                 <h2>wht is lorem ispsum?</h2>
  236.                 <p>It is a long established fact that a reader will be distracted by the readable like readable English. Many desktop publishing a </p>
  237.             </div>
  238.         </div>     
  239.         </div>  <!--End box-->
  240.  
  241.         <div class="box">
  242.             <div class="imgbox">
  243.                 <img src="img/1.jpg">
  244.             </div>
  245.         <div class="details">
  246.             <div class="content">
  247.                 <h2>wht is lorem ispsum?</h2>
  248.                 <p>It is a long established fact that a reader will be distracted by the readable like readable English. Many desktop publishing a </p>
  249.             </div>
  250.         </div>     
  251.         </div>  <!--End box-->
  252.  
  253.     </div>
  254.  
  255.  
  256.  
  257. </body>
  258. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement