Posted By

hanzwurzt on 12/03/09


Tagged

css


Versions (?)

Crop images with negative Margins


 / Published in: CSS
 

URL: http://cssglobe.com/post/6089/3-easy-and-fast-css-techniques-for-faux-image

  1. <p class="crop"><a href="http://templatica.com" title="Css Templates"><img src="img.jpg" alt="css template" /></a></p>
  2.  
  3. .crop{
  4. float:left;
  5. margin:.5em 10px .5em 0;
  6. overflow:hidden; /* this is important */
  7. border:1px solid #ccc;
  8. }
  9. /* input values to crop the image: top, right, bottom, left */
  10. .crop img{
  11. margin:-20px -15px -40px -55px;
  12. }

Report this snippet  

You need to login to post a comment.