Auto image resize based on browser window dimensions

后端 未结 4 1121
天涯浪人
天涯浪人 2020-12-14 04:52

I have a basic web page layout with a 100% width header and a sticky footer. In between the two I have a large graphic.

I would like the graphic to resize dynamicall

4条回答
  •  Happy的楠姐
    2020-12-14 05:31

        
    
    

    This will resize your image to match your container and keep the ratio in place. If you set the container to a percentage everything will scale.

    wrapper width = 960px divided by screen width = 1640px

    If you want the entire site to be responsive you have to do the math all the way down. divide the child by it's parent. Hope this helps!

提交回复
热议问题