CSS scale height to match width - possibly with a formfactor

前端 未结 10 1745
天涯浪人
天涯浪人 2020-12-04 11:28

I have implemented a GoogleMapsV3 map in a twitterBootstrap basic responsive design site.

But my question is quite simple: i have:

10条回答
  •  一生所求
    2020-12-04 11:39

    Try viewports

    You can use the width data and calculate the height accordingly

    This example is for an 150x200px image

    width: calc(100vw / 2 - 30px);
    height: calc((100vw/2 - 30px) * 1.34);
    

提交回复
热议问题