問題:
Is it possible to set same height as width (ratio 1:1)?是否可以設置與寬度相同的高度(比例爲 1:1)?
Example例子
+----------+
| body |
| 1:3 |
| |
| +------+ |
| | div | |
| | 1:1 | |
| +------+ |
| |
| |
| |
| |
| |
+----------+
CSS CSS
div {
width: 80%;
height: same-as-width
}
解決方案:
參考一: https://en.stackoom.com/question/MqcV參考二: https://stackoom.com/question/MqcV