×

Welcome to TagMyCode

Please login or create account to add a snippet.
1
0
 
0
Language: CSS
Posted by: Vincenzo Assenza
Added: Sep 22, 2015 11:05 AM
Modified: Sep 22, 2015 11:05 AM
Views: 10
Tags: css crop
  1. #container{
  2.     padding-bottom: 100%;
  3.     width: 100%;
  4.     position: relative;
  5.     overflow: hidden;
  6.    
  7.     img{
  8.         position: absolute;
  9.         left: 50%;
  10.         top: 50%;
  11.         height: 100%;
  12.         width: auto;
  13.         -webkit-transform: translate(-50%, -50%);
  14.         -ms-transform: translate(-50%, -50%);
  15.         transform: translate(-50%, -50%);
  16.     }
  17. }