CSS - Resize your background image


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



Copy this code and paste it in your HTML
  1. #resize-image {
  2.    /* Just imagine that the image_1.png is 200x400px */
  3.    background:url(image_1.png) top left no-repeat;
  4.    -moz-background-size: 100px 200px;
  5.    -o-background-size: 100px 200px;
  6.    -webkit-background-size: 100px 200px;
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.