html - Size a background image? -


i have div 200px 200px.

it's background image 500px x 500px.

is there way make sure entire background image fits div? know can size css3 i'm looking solution older browsers.

thanks

is there way make sure entire background image fits div?

the background-size property.

i know can size css3 i'm looking solution older browsers.

there no other standard way scale background image.


older versions of internet explorer can supported via non-standard filter property , alphaimageloader.

/* untested */ background-image: url(images/someimage.png); background-resize: cover; filter: "progid:dximagetransform.microsoft.alphaimageloader(src='images/someimage.png',sizingmethod='scale')"; -ms-filter: "progid:dximagetransform.microsoft.alphaimageloader(src='images/someimage.png',sizingmethod='scale')"; 

alternatively, hack, use <img> element, , absolutely position behind content. content image though, wouldn't clean hack.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -