image - IE or Firefox not autoresizing -


first off, i'm new , have been doing lot of research, can't find answer.

i have set div container @ top of page 100% width , 20% height. wanted insert image resize automatically across screen sizes.

i found code on site works in safari , chrome (also resizes on ipad , iphone) in firefox(20) , ie(10) image resize wont stay in parent container.

can help? original code have been using is:

<html> <style type="text/css"> #mydiv  { height:auto; width:auto; } #mydiv img { max-width:100%;  max-height:100%; margin:auto; display:block; } </style>   <div id="mydiv"> <img src="images/storm.jpg"> </div> </html> 

any appreciated (and please remember i'm learning!)

#mydiv img { width:100%;  height:100%; margin:auto; display:block; } 

you need set actual width/height of image 100%, not max-width , max-height.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -