0

Is there any idea to re-size its background image?

div{background: url("image.jpg") no-repeat;} 
/* here original image is  20px X 20px
and I would like to re-size its background image as 50px X 50px */
Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231

3 Answers3

1

You can use the background-size property but this is css3 and will only work in newer browsers

http://www.w3.org/TR/css3-background/#the-background-size

Pete
  • 57,112
  • 28
  • 117
  • 166
0

You can use ,

 -moz-background-size:
 -webkit-background-size:
  background-size:
zey
  • 5,939
  • 14
  • 56
  • 110
0

You can use background-size in CSS3 or in CSS2 you can use phpthumb

div{background: url("phpThumb.php?src=images/image.jpg&w=20&h=20") no-repeat;} 

check this site if you are interesed in php solution

http://phpthumb.sourceforge.net/demo/demo/phpThumb.demo.demo.php

Robert
  • 19,800
  • 5
  • 55
  • 85