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
  • 78,842
  • 31
  • 152
  • 211

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
  • 54,116
  • 25
  • 104
  • 150
0

You can use ,

 -moz-background-size:
 -webkit-background-size:
  background-size:
zey
  • 5,803
  • 14
  • 53
  • 100
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
  • 18,927
  • 5
  • 54
  • 81