Create Resizable Images With CSS


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. HTML:
  2.  
  3. <div class="resize2"><img src="image.jpg" alt="" /></div>
  4.  
  5.  
  6. CSS:
  7.  
  8. .resize2 {
  9. border: 3px double #333;
  10. float: left;
  11. height: 12em;
  12. margin: .2em 1em 1em 0;
  13. overflow: hidden;
  14. width: 12em;
  15. }
  16.  
  17. .resize2 img {
  18. margin: -220px 0 0 -210px;
  19. padding: 6em 0 0 6em;
  20. }

URL: http://www.smileycat.com/miaow/archives/000648.php

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.