Use CSS (and maybe JavaScript) to make an element be square (or maintain a specific aspect ratio)

前端 未结 4 1401
北恋
北恋 2020-12-11 19:04

I have a div that I want to have the following characteristics:

  • Width = 50% of its parent element
  • Height equal to whatever it needs to be in order to
4条回答
提交回复
热议问题