Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

css resize image

/* With img element */
.my-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* with background image */
.my-image {
  width: 500px;
  height: 400px;
  background-image: url('myurl.jpg');
  background-size: cover;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #css #resize #image
ADD COMMENT
Topic
Name
4+1 =